meta-window-actor: Change unredirection hints to match spec changes

Change the bypass / dont_bypass compositor code to match the latest
spec.

https://bugzilla.gnome.org/show_bug.cgi?id=693064
This commit is contained in:
Adel Gadllah 2013-02-02 20:05:43 +01:00
parent b9e21b76ae
commit 9a57626556
4 changed files with 19 additions and 43 deletions

View File

@ -62,6 +62,13 @@ typedef enum {
#define NUMBER_OF_QUEUES 3 #define NUMBER_OF_QUEUES 3
typedef enum {
_NET_WM_BYPASS_COMPOSITOR_HINT_AUTO = 0,
_NET_WM_BYPASS_COMPOSITOR_HINT_ON = 1,
_NET_WM_BYPASS_COMPOSITOR_HINT_OFF = 2,
} MetaBypassCompositorHintValue;
struct _MetaWindow struct _MetaWindow
{ {
GObject parent_instance; GObject parent_instance;
@ -421,8 +428,7 @@ struct _MetaWindow
MetaWindow *tile_match; MetaWindow *tile_match;
/* Bypass compositor hints */ /* Bypass compositor hints */
guint bypass_compositor : 1; guint bypass_compositor;
guint dont_bypass_compositor : 1;
}; };
struct _MetaWindowClass struct _MetaWindowClass

View File

@ -1619,53 +1619,25 @@ reload_bypass_compositor (MetaWindow *window,
MetaPropValue *value, MetaPropValue *value,
gboolean initial) gboolean initial)
{ {
gboolean requested_value = FALSE; int requested_value = 0;
gboolean current_value = window->bypass_compositor; int current_value = window->bypass_compositor;
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ requested_value = (int) value->v.cardinal;
requested_value = ((int) value->v.cardinal == 1);
meta_verbose ("Request to bypass compositor for window %s.\n", window->desc);
}
if (requested_value == current_value) if (requested_value == current_value)
return; return;
if (requested_value && window->dont_bypass_compositor) if (requested_value == _NET_WM_BYPASS_COMPOSITOR_HINT_ON)
{ meta_verbose ("Request to bypass compositor for window %s.\n", window->desc);
meta_verbose ("Setting bypass and dont compositor for same window (%s) makes no sense, ignoring.\n", window->desc); else if (requested_value == _NET_WM_BYPASS_COMPOSITOR_HINT_OFF)
return; meta_verbose ("Request to don't bypass compositor for window %s.\n", window->desc);
} else if (requested_value != _NET_WM_BYPASS_COMPOSITOR_HINT_AUTO)
return;
window->bypass_compositor = requested_value; window->bypass_compositor = requested_value;
} }
static void
reload_dont_bypass_compositor (MetaWindow *window,
MetaPropValue *value,
gboolean initial)
{
gboolean requested_value = FALSE;
gboolean current_value = window->dont_bypass_compositor;
if (value->type != META_PROP_VALUE_INVALID)
{
requested_value = ((int) value->v.cardinal == 1);
meta_verbose ("Request to don't bypass compositor for window %s.\n", window->desc);
}
if (requested_value == current_value)
return;
if (requested_value && window->bypass_compositor)
{
meta_verbose ("Setting bypass and dont compositor for same window (%s) makes no sense, ignoring.\n", window->desc);
return;
}
window->dont_bypass_compositor = requested_value;
}
#define RELOAD_STRING(var_name, propname) \ #define RELOAD_STRING(var_name, propname) \
static void \ static void \
reload_ ## var_name (MetaWindow *window, \ reload_ ## var_name (MetaWindow *window, \
@ -1766,7 +1738,6 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
{ display->atom__NET_WM_STRUT, META_PROP_VALUE_INVALID, reload_struts, FALSE, FALSE }, { display->atom__NET_WM_STRUT, META_PROP_VALUE_INVALID, reload_struts, FALSE, FALSE },
{ display->atom__NET_WM_STRUT_PARTIAL, META_PROP_VALUE_INVALID, reload_struts, FALSE, FALSE }, { display->atom__NET_WM_STRUT_PARTIAL, META_PROP_VALUE_INVALID, reload_struts, FALSE, FALSE },
{ display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_bypass_compositor, FALSE, FALSE }, { display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_bypass_compositor, FALSE, FALSE },
{ display->atom__NET_WM_DONT_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_dont_bypass_compositor, FALSE, FALSE },
{ 0 }, { 0 },
}; };

View File

@ -3656,7 +3656,7 @@ meta_window_is_on_primary_monitor (MetaWindow *window)
gboolean gboolean
meta_window_requested_bypass_compositor (MetaWindow *window) meta_window_requested_bypass_compositor (MetaWindow *window)
{ {
return window->bypass_compositor; return window->bypass_compositor == _NET_WM_BYPASS_COMPOSITOR_HINT_ON;
} }
/** /**
@ -3667,7 +3667,7 @@ meta_window_requested_bypass_compositor (MetaWindow *window)
gboolean gboolean
meta_window_requested_dont_bypass_compositor (MetaWindow *window) meta_window_requested_dont_bypass_compositor (MetaWindow *window)
{ {
return window->dont_bypass_compositor; return window->bypass_compositor == _NET_WM_BYPASS_COMPOSITOR_HINT_OFF;
} }
void void

View File

@ -173,7 +173,6 @@ item(_NET_WM_STATE_STICKY)
item(_NET_WM_FULLSCREEN_MONITORS) item(_NET_WM_FULLSCREEN_MONITORS)
item(_NET_WM_STATE_FOCUSED) item(_NET_WM_STATE_FOCUSED)
item(_NET_WM_BYPASS_COMPOSITOR) item(_NET_WM_BYPASS_COMPOSITOR)
item(_NET_WM_DONT_BYPASS_COMPOSITOR)
#if 0 #if 0
/* We apparently never use: */ /* We apparently never use: */