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 650661 - Blue rectangle drawn above the window when tiling if another window is marked as “always on top”
Blue rectangle drawn above the window when tiling if another window is marked...
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
3.0.x
Other Linux
: Normal minor
: ---
Assigned To: Owen Taylor
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2011-05-20 12:27 UTC by Andrea Bolognani
Modified: 2011-07-09 00:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core: Improve lower_beneath_focus_window() (1.09 KB, patch)
2011-05-20 15:50 UTC, Florian Müllner
none Details | Review
core: Replace lower_beneath_focus_window() (3.81 KB, patch)
2011-07-08 23:10 UTC, Florian Müllner
committed Details | Review

Description Andrea Bolognani 2011-05-20 12:27:05 UTC
If a window is marked as “always on top”, and another window is dragged to one of the edges in order to tile/maximize it, the blue rectangle which is usually drawn below the window being dragged is drawn below the “always on top” window, that is, above the window being dragged.

Performing the test with two “always on top” windows shows clearly that the blue rectangle is always drawn below the window at the top of the focus stack.
Comment 1 Florian Müllner 2011-05-20 15:15:44 UTC
(In reply to comment #0)
> Performing the test with two “always on top” windows shows clearly that the
> blue rectangle is always drawn below the window at the top of the focus stack.

Right. Reassigning to mutter, which is were tiling is implemented.
Comment 2 Florian Müllner 2011-05-20 15:50:59 UTC
Created attachment 188229 [details] [review]
core: Improve lower_beneath_focus_window()

The code assumed that the focus window was always the one at the
top of the window stack, which is not true if an unfocused window
has the above hint set.
To fix, iterate over the stack if necessary until the actual focus
window is found.
Comment 3 Florian Müllner 2011-05-20 17:24:58 UTC
By the way, I think the fix makes a good candidate for 3.0.2, so a quick review would be appreciated.
Comment 4 Owen Taylor 2011-07-08 19:45:44 UTC
Review of attachment 188229 [details] [review]:

What if we replaced lower_beneath_focus_window() with lower_beneath_grab_window()?
Comment 5 Florian Müllner 2011-07-08 20:56:49 UTC
(In reply to comment #4)
> Review of attachment 188229 [details] [review]:
> 
> What if we replaced lower_beneath_focus_window() with
> lower_beneath_grab_window()?

And use display->grab_window? Sure, would work for me ...
Comment 6 Owen Taylor 2011-07-08 20:58:42 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Review of attachment 188229 [details] [review] [details]:
> > 
> > What if we replaced lower_beneath_focus_window() with
> > lower_beneath_grab_window()?
> 
> And use display->grab_window? Sure, would work for me ...

Seems that is what we want - I was spending a lot of time poking around trying to figure out if there was ever a case where the focus window wasn't the window being dragged about (like maybe not-focusable windows), but it struck me that if we want the grab window, we should use the grab window.
Comment 7 Florian Müllner 2011-07-08 23:10:28 UTC
Created attachment 191545 [details] [review]
core: Replace lower_beneath_focus_window()

The code assumed that the focus window was always the one at the
top of the window stack, which is not true if an unfocused window
has the above hint set.

Rather than fixing this assumption, rename the function to
lower_beneath_grab_window() and use the display's grab window - the
function is only used for displaying the tile previews, which means
that we want the grab window anyway.
Comment 8 Florian Müllner 2011-07-08 23:14:05 UTC
Comment on attachment 188229 [details] [review]
core: Improve lower_beneath_focus_window()

(In reply to comment #6)
> Seems that is what we want - I was spending a lot of time poking around trying
> to figure out if there was ever a case where the focus window wasn't the window
> being dragged about (like maybe not-focusable windows), but it struck me that
> if we want the grab window, we should use the grab window.

Yeah, the function is only used to show the tile previews, so we do want the grab window. I don't remember why I didn't use that in the first place, maybe because the grab window can be more obviously unset?
Comment 9 Owen Taylor 2011-07-09 00:19:21 UTC
Review of attachment 191545 [details] [review]:

Looks good
Comment 10 Florian Müllner 2011-07-09 00:57:01 UTC
Comment on attachment 191545 [details] [review]
core: Replace lower_beneath_focus_window()

Committed (with git-bz bailing out for some reason) ...