Add better tracking of real stacking order

Wedging override-redirect windows into the constraint code in stack.c
results in Mutter getting confused about the stacking order of
these windows with respect to other windows, and may also in some
cases cause Mutter to restack override-redirect windows.

core/stack-tracker.c core/stack-tracker.h: MetaStackTracker - combine
  events received from the X server with local changes we have made
  to come up with the best possible idea of what the stacking order
  is at any one point in time.

core/screen.c core/screen-private.h: Create a MetaStackTracker for
  the screen.

core/display.c: Feed relevant events to MetaStackTracker

core/frame.c core/screen.c core/stack.c: When we make changes to the
  stacking order or add windows, record those changes immediatley
  in MetaStackTracker so we have the information without waiting
  for a round-trip.

include/ui.h ui/ui.c: meta_ui_create_frame_window add a return value
  for the X request serial used to create the window.

http://bugzilla.gnome.org/show_bug.cgi?id=585984
This commit is contained in:
Owen W. Taylor
2009-06-13 16:45:32 -04:00
parent 729fb2e0b4
commit a4cd66f599
10 changed files with 825 additions and 7 deletions

View File

@ -159,7 +159,8 @@ meta_ui_create_frame_window (MetaUI *ui,
gint y,
gint width,
gint height,
gint screen_no)
gint screen_no,
gulong *create_serial)
{
GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay);
GdkScreen *screen = gdk_display_get_screen (display, screen_no);
@ -208,6 +209,12 @@ meta_ui_create_frame_window (MetaUI *ui,
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
/* We make an assumption that gdk_window_new() is going to call
* XCreateWindow as it's first operation; this seems to be true currently
* as long as you pass in a colormap.
*/
if (create_serial)
*create_serial = XNextRequest (xdisplay);
window =
gdk_window_new (gdk_screen_get_root_window(screen),
&attrs, attributes_mask);