GNOME Bugzilla – Bug 700419
Trigger toggle maximize on double click in menubar/menushell
Last modified: 2013-11-09 19:28:19 UTC
While testing some Gnome apps in maximized mode, I had a couple of people telling me that once Totem (for example) is maximized by double clicking the top window decoration of the window, they are confused about how to switch back to unmaximized mode. Mostly because there is no way to double click somewhere else to 'invert' the maximize behvaior. It's only possible to drag the window away for the top of the screen. Here is a patch to add maximize toggle support to the menubar/menushell so in addition to the drag behavior they already, they also support double click to toggle the maximized state.
Created attachment 244361 [details] [review] menushell: implement toggle maximize on double click
Added Allan who was receptive to the idea on IRC.
Review of attachment 244361 [details] [review]: I think that is _somewhat_ dubious - the style property controlling this is called ::window-dragging and is documented to control just that. At the very least, we should update the documentation of the style property to mention this new feature. Also, it might be nice to refactor this and have an internal gtk_window function to do this button event handling, rather than maintaining 3 identical copies (in gtkmenushell, gtktoolbar and gtkwindow).
Fair enough. Just one question, where is the code in GtkWindow dealing with window dragging? All I see are help functions, no code actually dealing with press event etc...
https://git.gnome.org/browse/gtk+/tree/gtk/gtkwindow.c#n7017
Created attachment 250119 [details] [review] menushell/toolbar/window: implement toggle maximize on double click
(In reply to comment #6) > Created an attachment (id=250119) [details] [review] > menushell/toolbar/window: implement toggle maximize on double click I can confirm this works as expected ; double-click works, and setting : .menubar { -GtkWidget-window-dragging: false; } in the theme "gtk.css" disables both drag-away and double-click.
Created attachment 256736 [details] [review] menushell/toolbar/window: implement toggle maximize on double click Slightly the same code, but updated for latest git (new line numbers).