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 165718 - Always on top ignored when returning from full screen
Always on top ignored when returning from full screen
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
trunk
Other Linux
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks: 155452
 
 
Reported: 2005-01-30 16:04 UTC by Vincent Untz
Modified: 2005-01-31 16:51 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Resize the window before updating the layer (885 bytes, patch)
2005-01-31 03:26 UTC, Elijah Newren
accepted-commit_now Details | Review

Description Vincent Untz 2005-01-30 16:04:08 UTC
1. Have two windows, say epiphany & gnome-terminal
2. Select "always on top" for gnome-terminal
3. Focus epiphany. The terminal is staying on top
4. Hit F11 (keybinding in epiphany for fullscreen). You only see epiphany.
5. Hit F11 to leave fullscreen. Start wondering where your always on top
terminal is :-)
Comment 1 Elijah Newren 2005-01-30 22:14:45 UTC
Hmmm...

DOCKS are at the always on top level, and we want panels to not obscure
fullscreen windows.  We could get the behavior you want by saying docks have a
different layer than always on top ones, and always on top trump fullscreen. 
But I think most people use always on top for windows such as gkrellm and such
in order to act like panels.  So we wouldn't want those windows to obscure
fullscreen things.  Typically, fullscreen is used for video players and such
which we don't want obscured.

I can't think of a good way to get the behavior you want without either ruining
the majority use case or making things much more complex.  I'm leaning towards
writing off this niche use case, but I'm open to better ideas.  The only thing
that occurs to me right now would be to introduce a second fullscreen-like state
for apps to use and set hints on.  It'd have to be in the EWMH, or else it'd
just be a hack that doesn't work for all apps (and even then, would panels be
able to obscure such windows?).  But having two fullscreen states with almost
identical meaning and only differing in "whether it's okay for the window to be
obscured" seems suboptimal--especially since it'd be difficult to differentiate
what is allowed to obscure it (panels vs. other windows marked as
always-on-top).  Got any bright ideas?
Comment 2 Vincent Untz 2005-01-30 22:31:47 UTC
Elijah: I think you misunderstood the problem. I'm perfectly fine with always on
top not being on top of fullscreen. The problem is that when you leave
fullscreen, always on top is not on top. Okay, I guess it isn't clearer :-)

Let's try an example:

  +-------+
+---+     |
+---+     |
  +-------+
Figure 1. Two windows, small window is always on top

Let's say the small window is always on top. Now, I make the big window fullscreen:
+-------------+
|             |
|             |
|             |
|             |
+-------------+
Figure 2. Fullscreen

We don't see the small always on top window and I'm fine with this. Ok, now, I
want to leave fullscreen. I expect to have the same thing than in figure 1. But
I get this:

  +-------+
+-|       |
+-|       |
  +-------+
Figure 3. Two windows, small window is always on top, but metacity is wrong!

Now this should be clearer :-)
I should consider starting a new career in ASCII art...
Comment 3 Elijah Newren 2005-01-30 22:41:22 UTC
Ah, I see and I can duplicate too.  Yeah, we need to fix that.
Comment 4 Elijah Newren 2005-01-31 03:25:53 UTC
Ok, found the problem.  meta_window_unmake_fullscreen sets window->fullscreen to
FALSE, then updates the layer (meta_window_update_layer()), and then it resizes
the window (meta_window_move_resize()) to its original size.  This sequence
causes problems in computing the layer because of this snippet of code:
  else if ((window->fullscreen || window_is_fullscreen_size (window)) &&
  ...
Since the window hasn't been resized yet, it is still believed to be fullscreen
size even if it isn't fullscreen--and is thus thrown in the fullscreen layer.

I'll attach a patch in a minute.
Comment 5 Elijah Newren 2005-01-31 03:26:41 UTC
Created attachment 36749 [details] [review]
Resize the window before updating the layer
Comment 6 Elijah Newren 2005-01-31 16:51:32 UTC
committed.