After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 666359 - panel: Allow to start a drag to restore a window from the panel
panel: Allow to start a drag to restore a window from the panel
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-12-16 12:41 UTC by Florian Müllner
Modified: 2012-02-29 15:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
panel: Allow to start a drag to restore a window from the panel (3.50 KB, patch)
2011-12-16 12:41 UTC, Florian Müllner
needs-work Details | Review
panel: Allow to start a drag to restore a window from the panel (3.33 KB, patch)
2012-02-28 12:49 UTC, Florian Müllner
reviewed Details | Review
panel: Allow to start a drag to restore a window from the panel (3.25 KB, patch)
2012-02-28 18:00 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2011-12-16 12:41:36 UTC
Just a suggestion, see patch.
Comment 1 Florian Müllner 2011-12-16 12:41:39 UTC
Created attachment 203660 [details] [review]
panel: Allow to start a drag to restore a window from the panel

The preferred way to unmaximize/untile a window is by using a drag
gesture. Extend the available area to start this gesture into
non-reactive parts of the top bar above the window - with that we
take advantage of the "infinite height" of the screen edge, and the
extra space is particularly useful when the window has its titlebar
hidden.
Comment 2 Giovanni Campagna 2011-12-16 12:57:49 UTC
Just a small commment: why passing 0 for the modifier mask?
clutter_event_get_state() should give you the mask for a button-press-event, if you remove mouse buttons (or ignore them in mutter)
(at least, I checked the XI2 case and it is indeed set)
Comment 3 Owen Taylor 2012-01-25 18:24:24 UTC
Review of attachment 203660 [details] [review]:

Generally looks good if you have approval from the designers (they don't want it just for hidden-titlebar windows?)

::: js/ui/panel.js
@@ +1043,3 @@
+
+        let dragWindow = focusWindow.is_attached_dialog() ? focusWindow.get_transient_for()
+                                                          : focusWindow;

You need to walk up until you find a non-attached dialog which might be a grandparent, etc

@@ +1051,3 @@
+
+        let allowDrag = dragWindow.maximized_vertically &&
+                        stageX > rect.x && stageX < rect.x + rect.width;

Probably >= for consistency with general "contained in rectangle", though matters not much

@@ +1062,3 @@
+                                     true, /* frame action */
+                                     event.get_button(),
+                                     0, /* modifier mask; we'd need to connect

As giovanni said, the modifier mask is in button events - Shell.get_event_state(event);
Comment 4 Florian Müllner 2012-01-25 18:29:31 UTC
(In reply to comment #3)
> As giovanni said, the modifier mask is in button events -
> Shell.get_event_state(event);

Right, though thinking about it, I'd only use it to assure that no modifier is present (e.g. only extend the "normal" left-click-no-modifiers to the top bar - having different actions for mod+click on the titlebar and top bar feels confusing).

Anyway, I haven't heard anything from the designers yet, so not updating the patch for now.
Comment 5 Jakub Steiner 2012-02-28 12:08:16 UTC
Without actually playing with it, I like this. On one hand toolbarless maximized apps sound like quite an exception, but web apps work really well like that (through Epiphany appification). 

I haven't managed to apply this on master, but I think this approach would be better than what I initially had in mind -- using the app menu. I don't think we should specialcase only the toolbarless windows with this. If all windows behave like this, we lower the element of surprise.
Comment 6 Florian Müllner 2012-02-28 12:41:26 UTC
(In reply to comment #5)
> I don't think we should specialcase only the toolbarless windows with this. 
> If all windows behave like this, we lower the element of surprise.

Currently we don't special-case at all, i.e. we allow the behavior for all maximized/tiled windows (regardless whether they have or don't have a toolbar/titlebar/whatever)
Comment 7 Florian Müllner 2012-02-28 12:49:36 UTC
Created attachment 208574 [details] [review]
panel: Allow to start a drag to restore a window from the panel

Limit behavior to right-clicks + pass on modifier state.
Comment 8 Rui Matos 2012-02-28 15:09:10 UTC
Review of attachment 208574 [details] [review]:

I like this. The code looks right except for one doubt:

::: js/ui/panel.js
@@ +1063,3 @@
+    _onButtonPress: function(actor, event) {
+        if (!Meta.prefs_get_edge_tiling())
+            return false;

I don't think this condition is needed. Don't we want this to work for regular maximized windows even if tiling is disabled?
Comment 9 Florian Müllner 2012-02-28 18:00:01 UTC
Created attachment 208617 [details] [review]
panel: Allow to start a drag to restore a window from the panel

Right, there's no good reason to not apply the same behavior to the "shaking-loose" behavior ...
Comment 10 Rui Matos 2012-02-28 23:18:44 UTC
Review of attachment 208617 [details] [review]:

Looks fine to me.
Comment 11 Florian Müllner 2012-02-29 12:51:48 UTC
Attachment 208617 [details] pushed as f4b58f3 - panel: Allow to start a drag to restore a window from the panel
Comment 12 Lapo Calamandrei 2012-02-29 15:08:57 UTC
Nice!!!