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:
parent
b9e21b76ae
commit
9a57626556
@ -62,6 +62,13 @@ typedef enum {
|
||||
|
||||
#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
|
||||
{
|
||||
GObject parent_instance;
|
||||
@ -421,8 +428,7 @@ struct _MetaWindow
|
||||
MetaWindow *tile_match;
|
||||
|
||||
/* Bypass compositor hints */
|
||||
guint bypass_compositor : 1;
|
||||
guint dont_bypass_compositor : 1;
|
||||
guint bypass_compositor;
|
||||
};
|
||||
|
||||
struct _MetaWindowClass
|
||||
|
@ -1619,53 +1619,25 @@ reload_bypass_compositor (MetaWindow *window,
|
||||
MetaPropValue *value,
|
||||
gboolean initial)
|
||||
{
|
||||
gboolean requested_value = FALSE;
|
||||
gboolean current_value = window->bypass_compositor;
|
||||
int requested_value = 0;
|
||||
int current_value = window->bypass_compositor;
|
||||
|
||||
if (value->type != META_PROP_VALUE_INVALID)
|
||||
{
|
||||
requested_value = ((int) value->v.cardinal == 1);
|
||||
meta_verbose ("Request to bypass compositor for window %s.\n", window->desc);
|
||||
}
|
||||
requested_value = (int) value->v.cardinal;
|
||||
|
||||
if (requested_value == current_value)
|
||||
return;
|
||||
|
||||
if (requested_value && window->dont_bypass_compositor)
|
||||
{
|
||||
meta_verbose ("Setting bypass and dont compositor for same window (%s) makes no sense, ignoring.\n", window->desc);
|
||||
return;
|
||||
}
|
||||
if (requested_value == _NET_WM_BYPASS_COMPOSITOR_HINT_ON)
|
||||
meta_verbose ("Request to bypass compositor for window %s.\n", window->desc);
|
||||
else if (requested_value == _NET_WM_BYPASS_COMPOSITOR_HINT_OFF)
|
||||
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;
|
||||
}
|
||||
|
||||
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) \
|
||||
static void \
|
||||
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_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_DONT_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_dont_bypass_compositor, FALSE, FALSE },
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
|
@ -3656,7 +3656,7 @@ meta_window_is_on_primary_monitor (MetaWindow *window)
|
||||
gboolean
|
||||
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
|
||||
meta_window_requested_dont_bypass_compositor (MetaWindow *window)
|
||||
{
|
||||
return window->dont_bypass_compositor;
|
||||
return window->bypass_compositor == _NET_WM_BYPASS_COMPOSITOR_HINT_OFF;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -173,7 +173,6 @@ item(_NET_WM_STATE_STICKY)
|
||||
item(_NET_WM_FULLSCREEN_MONITORS)
|
||||
item(_NET_WM_STATE_FOCUSED)
|
||||
item(_NET_WM_BYPASS_COMPOSITOR)
|
||||
item(_NET_WM_DONT_BYPASS_COMPOSITOR)
|
||||
|
||||
#if 0
|
||||
/* We apparently never use: */
|
||||
|
Loading…
Reference in New Issue
Block a user