Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Title bar visible after starting an application maximized #2

Open
theArchonius opened this issue Oct 29, 2014 · 22 comments
Open

Title bar visible after starting an application maximized #2

theArchonius opened this issue Oct 29, 2014 · 22 comments

Comments

@theArchonius
Copy link

I'm using Ubuntu Gnome 14.10 with GNOME Shell 3.12.2.
The extension works well if I maximize or minimize a running application window - but if an application starts maximized, the title bar remains visible (but you can't use the minimize/maximize/close buttons on it).
Minimizing and maximizing the window hides the title bar, but it's annoying to do that every time the application starts...

@oliveiraev
Copy link

👍
Gnome Shell 3.12.2 @ Ubuntu-Gnome 14.10

@wilfm
Copy link
Owner

wilfm commented Oct 30, 2014

I can reproduce this issue (with most applciations) - I shall fix it when I have time

@psivesely
Copy link

I have almost the same bug--for me the title bar just appears black on apps launched fullscreen--and un- then re-maximizing it also fixes for me. I'm using Gnome Shell 3.14.1.5.

@JonathanReeve
Copy link

I think I'm having a similar issue. For me, when I'm running a maximized app, then suspend and wake up my computer, the formerly maximized app appears with a black bar at the top of the screen where the title bar would have been. Unmaximizing and remaximizing it fixes it, but it's annoying to have to do that every time.

@ArchKudo
Copy link

I also have the same problem with chromium and firefox and others, however it works fine with gnome apps like gedit, gnome-terminal....Hope you fix that soon, Anyways thanks for the amazing extension.. GNOME Shell 3.14.1.5 (Arch Linux 3.17.2-1-ARCH)

@aditiapratama
Copy link

affecting me as well, ubuntu 14.10 GNOME Shell 3.14.1

@tomm
Copy link

tomm commented Nov 25, 2014

Affecting me too. Debian 8 (testing), gnome shell 3.14.1. I see black title bars on newly opened maximised windows. Hit alt-f10-f10 and the black bar disappears.

@mpdeimos
Copy link

Same here. For some windoes this is reproducible if I maximze then lock screen and then unlock. Result is black titlebar.

@wilfm wilfm self-assigned this Dec 23, 2014
@mk0x9
Copy link

mk0x9 commented Dec 30, 2014

Fedora 21, gnome-shell 3.14.2, same as #13. Need to press M-down and M-up to restore state of the window after screenlock.

@muhammedabuali
Copy link

I think this issue can be fixed with an ugly hack using wmctrl

@ronjouch
Copy link

@muhammedabuali can you post your ugly hack here? I'll be glad to try it out.

@muhammedabuali
Copy link

@ronjouch sure.
the idea is that the blak top bar appears because the extension hides the titlebar after the etension is opened and it disapears if we manually unmaximize and maximize again.

with wmctrl given the id of the window we can make it full screen and not full screen later so it will appear normal
here is a script to toggle the titlebar of the current window
to make the title appear set the flag to 0

FLAG=1 ;\
ID=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2);\
xprop -id $ID -f _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED 32c -set _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED $FLAG;\
wmctrl -i -r $ID -b add,fullscreen ;\
sleep 0.01 ;\
wmctrl -i -r $ID -b remove,fullscreen

@muhammedabuali
Copy link

to apply this hack :
you need wmctrl installed
edit the file

.local/share/gnome-shell/extensions/maximus-two@wilfinitlike.gmail.com/decoration.js

go to the line 125 and insert after it the following

    let cmd_full = ['wmctrl', '-i', '-r' , id , '-b', 'add,fullscreen'];
    let sleep_time = '0.01'
    let cmd_sleep = ['sleep', sleep_time];
    let cmd_unfull = ['wmctrl', '-i', '-r' , id , '-b', 'remove,fullscreen'];

    Util.spawn(cmd_full);
    Util.spawn(cmd_sleep);
    Util.spawn(cmd_unfull);

@ronjouch
Copy link

@muhammedabuali thanks for sharing your patch! Just tried it, but on my 4-years-old laptop, it yields irregular results:

  • Sometimes it works (titlebar not visible).
  • Sometimes it doesn't (black titlebar).
  • Sometimes window stays in fullscreen state.

I tried fiddling with the sleep_time, that didn't change anything. Is your script always working on your machine? Am using wmctrl 1.07 on Gnome 3.16.0 and Linux 3.19.3-3-ARCH.

@muhammedabuali
Copy link

I haven't encountered the second case on my machine
I have the exact setup as you

@muhammedabuali
Copy link

I think this works out better

add this to the constants in the start of the decoration.js file

const MAXIMIZED = (Meta.MaximizeFlags.HORIZONTAL | Meta.MaximizeFlags.VERTICAL);

and replace the older snippet with this one

if (hide) {
        let cmd_toggle = ['wmctrl', '-i', '-r' , id , '-b', 'toggle,maximized_vert,maximized_horz'];
        let cmd_full = ['wmctrl', '-i', '-r' , id , '-b', 'add,maximized_vert,maximized_horz'];

        if (win.get_maximized() === MAXIMIZED && !win.minimized) {
            Util.spawn(cmd_toggle);
            Util.spawn(cmd_toggle);
            Util.spawn(cmd_full);
        }
}

@ronjouch
Copy link

@muhammedabuali cool, this second approach seems to work more frequently (I'd say ~80% on my machine). However, once in a while I end up in one of two failure states: a. displaying the black titlebar, or b. window ending up appearing unmaximized (windowed).

Leaving it activated and trying to fiddle with it.

@wilfm
Copy link
Owner

wilfm commented Apr 14, 2015

nice idea - I will try having a fiddle around as well and see if it improves anything or can be improved.
A thing I haven't checked is whether xprop & xwininfo (and wmctrl) work under Wayland. I suspect not, so the Wayland window manager may need a special version of the extension using whatever tools it has.

gutenye added a commit to gutenye/GnomeExtensionMaximusTwo that referenced this issue Apr 19, 2015
@gutenye
Copy link

gutenye commented Apr 19, 2015

@wilfm I run GNOME 3.16 on Archlinux under Wayland, it works with @muhammedabuali 's patch

gutenye added a commit to gutenye/GnomeExtensionMaximusTwo that referenced this issue Apr 19, 2015
gutenye added a commit to gutenye/GnomeExtensionMaximusTwo that referenced this issue Apr 19, 2015
gutenye added a commit to gutenye/GnomeExtensionMaximusTwo that referenced this issue Apr 19, 2015
johnhoran added a commit to johnhoran/GnomeExtensionMaximusTwo that referenced this issue Apr 21, 2015
Seems to fix the bug where a black bar would sometimes replace the title bar.
@wilfm
Copy link
Owner

wilfm commented Aug 5, 2015

Probably the issues fixed for current versions with updates, but once I have sorted out documentation, other pull requests etc I'll make a few development versions available with interesting fixes like this.

@ronjouch
Copy link

ronjouch commented Aug 5, 2015

Am running v5 from the github releases zip, indeed it looks fixed 👍

@Pajn
Copy link

Pajn commented Oct 11, 2015

I have this issue with latest version on extensions.gnome.org, is that an older version than the one here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests