negesti / gnome-shell-extensions-negesti

An gnome-shell extension that makes window movement a lot easier.
GNU General Public License v3.0
287 stars 46 forks source link

Initial window size isn't restored after maximize #110

Closed sojusnik closed 7 years ago

sojusnik commented 7 years ago

When a window is maximized (with a move to center/maximize shortcut), then the initial window size isn't restored, although it works with f.i. move to right, like you'll see in this video.

Shortcuts used in the video: move to right move to right move to right unmaximize (see in dconf at org.gnome.desktop.wm.keybindings) move to center/maximize (only once) unmaximize move to center/maximize (twice) unmaximize

As you can see, after move to center/maximize (twice) the window takes the center width, specified in the extensions' settings (in my case 70).

Is this a bug or by design?

For me it would be much better and logical, if the initial window size would be also restored after using move to center/maximize twice.

negesti commented 7 years ago

It's kind of "by design" :)

What you describe is the build in functionality of maximize and unmaximize (super up, down). Must of the time I use "move to center" to move a small window to the center of the screen, maximize it if it's still to small and then move it "back" using win + numPad.

I will come back to this, once the extension works properly on gnome-shell 3.22.

If you want to fix this on you own, you just have to change extension.js _moveFocused function:

    // line 595
    if (where == "c")  {

        // TODO check the config how move-to-center should behave

         var flags = Meta.MaximizeFlags.HORIZONTAL | Meta.MaximizeFlags.VERTICAL;
         if (win.maximized_horizontally && win.maximized_vertically) {
            win.unmaximize(flags);
         } else {
            win.maximize(flags);
         }

    }
sojusnik commented 7 years ago

I see, thanks for clarifying that!

sojusnik commented 7 years ago

@negesti Can you officially add the code from your last post to the extension and make an appropriate setting for it please? It's very inconvenient to edit the code manually after every update :/

negesti commented 7 years ago

sorry totally forgot about that, fix is on the way

negesti commented 7 years ago

question remains which issue i wanted to tag with "Wont fix" :confused:

sojusnik commented 7 years ago

Thanks :))

sojusnik commented 7 years ago

Just wanted to ask, if you've submitted the new version, with this fix, to gnome extension website, since I didn't receive an update on that?

negesti commented 7 years ago

The extension is not working properly with wayland and ends up in a SegFaul everytime time preferences windows is opened. I have to find an alternative to get the running apps from wayland. wnck is obviously not an option..