mutter/src/compositor/mutter-window-private.h
Owen W. Taylor 6726fcd25d Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.

Simplify this so that visibility is controlled by:

 meta_compositor_show_window()
 meta_compositor_hide_window()

With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)

The map state of the window is signalled separately by:

 meta_compositor_map_window()
 meta_compositor_unmap_window()

And is used only to control resource handling.

Other changes:

 * The desired effect on show/hide is explicitly stored in
   MetaWindow, avoiding the need for the was_minimized flag.
   At idle, once we calculate the window state, we pass the
   effect to the compositor if it matches the new window
   state, and then clear the effect to start over for future
   map state changes.

 * meta_compositor_switch_workspace() is called before any windows
   are hidden or shown, allowing the compositor to avoid hiding
   or showing an effect for windows involved in the switch.
   http://bugzilla.gnome.org/show_bug.cgi?id=582341

 * Handling of post-effect cleanups for MutterWindow are
   simplified - instead of trying to do different things based
   on the individual needs of different effects, we just wait until
   all effects complete and sync the window state to what it
   should be.

 * On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
   that we've done so, so it can clean up and unbind. (The
   unbinding doesn't seem to be working properly because of
   ClutterGLXPixmap or video driver issues.)

http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-07-06 00:16:23 +01:00

43 lines
1.8 KiB
C

/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#ifndef MUTTER_WINDOW_PRIVATE_H
#define MUTTER_WINDOW_PRIVATE_H
#include <X11/extensions/Xdamage.h>
#include "compositor-mutter.h"
MutterWindow *mutter_window_new (MetaWindow *window);
void mutter_window_destroy (MutterWindow *cw);
void mutter_window_show (MutterWindow *cw,
MetaCompEffect effect);
void mutter_window_hide (MutterWindow *cw,
MetaCompEffect effect);
void mutter_window_maximize (MutterWindow *cw,
MetaRectangle *old_rect,
MetaRectangle *new_rect);
void mutter_window_unmaximize (MutterWindow *cw,
MetaRectangle *old_rect,
MetaRectangle *new_rect);
void mutter_window_process_damage (MutterWindow *cw,
XDamageNotifyEvent *event);
void mutter_window_pre_paint (MutterWindow *self);
gboolean mutter_window_effect_in_progress (MutterWindow *cw);
void mutter_window_sync_actor_position (MutterWindow *cw);
void mutter_window_sync_visibility (MutterWindow *cw);
void mutter_window_update_window_type (MutterWindow *cw);
void mutter_window_update_shape (MutterWindow *cw,
gboolean shaped);
void mutter_window_update_opacity (MutterWindow *cw);
void mutter_window_mapped (MutterWindow *cw);
void mutter_window_unmapped (MutterWindow *cw);
void mutter_window_effect_completed (MutterWindow *actor,
gulong event);
#endif /* MUTTER_WINDOW_PRIVATE_H */