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 381127 - Should grab the server when switching workspaces
Should grab the server when switching workspaces
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
2.12.x
Other All
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2006-12-01 02:19 UTC by Federico Mena Quintero
Modified: 2006-12-03 20:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
metacity-workspace-switch-server-grab.diff (1.76 KB, patch)
2006-12-01 02:20 UTC, Federico Mena Quintero
none Details | Review

Description Federico Mena Quintero 2006-12-01 02:19:11 UTC
This bug is easy to reproduce:

- In workspace A, maximize a window.

- In workspace B, maximize another window.  Put a small non-maximized window on top of B.

- Flip between workspaces A and B.  When flipping to B, you will see a flash of the desktop background before the big window is repainted.

This happens because Metacity lacks two little things that are needed to make switching workspaces as smooth as possible:

1. It needs to grab the server while windows are being hidden and shown.

2. It needs to first show the windows to be shown in front-to-back order, and then hide the windows to be hidden in back-to-front order.

(2) Minimizes the number of expose events that get generated for windows.  (1) ensures that this really happens, given the asynchronous nature of X.

The attached patch implements this.
Comment 1 Federico Mena Quintero 2006-12-01 02:20:51 UTC
Created attachment 77462 [details] [review]
metacity-workspace-switch-server-grab.diff
Comment 2 Havoc Pennington 2006-12-01 06:09:59 UTC
Grabbing the server is a little extreme IMO, though if it is a noticeable improvement maybe it's worth it.
Comment 3 Federico Mena Quintero 2006-12-01 16:24:12 UTC
FVWM and Sawfish do the same thing, by the way.
Comment 4 Havoc Pennington 2006-12-01 17:45:35 UTC
The patch looks fine to me, showing before hiding makes sense. If the grab server improvement is noticeable then why not go for it.
Comment 5 Federico Mena Quintero 2006-12-03 20:06:07 UTC
Thanks!  Committed to HEAD.

2006-12-03  Federico Mena Quintero  <federico@novell.com>

	Fix http://bugzilla.gnome.org/show_bug.cgi?id=381127:

	* src/window.c (idle_calc_showing): Grab the server while the
	windows are being shuffled.  First show the windows to be shown, 
	and then hide the windows to be hidden, in order to minimize
	the number of expose events.