Add pointer barriers to panel and message tray
If you have XFixes 5 (and corresponding xserver support) then we add barriers on the panel and in the message tray corner so that its easy to reach the corners even when there are monitors to the sides of the primary monitor. https://bugzilla.gnome.org/show_bug.cgi?id=622655
This commit is contained in:

committed by
Florian Müllner

parent
fd3f2289c3
commit
1518dc9b60
@ -884,6 +884,61 @@ shell_global_display_is_grabbed (ShellGlobal *global)
|
||||
return meta_display_get_grab_op (display) != META_GRAB_OP_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* shell_global_create_pointer_barrier
|
||||
* @global: a #ShellGlobal
|
||||
* @x1: left X coordinate
|
||||
* @y1: top Y coordinate
|
||||
* @x2: right X coordinate
|
||||
* @y2: bottom Y coordinate
|
||||
* @directions: The directions we're allowed to pass through
|
||||
*
|
||||
* If supported by X creates a pointer barrier.
|
||||
*
|
||||
* Return value: value you can pass to shell_global_destroy_pointer_barrier()
|
||||
*/
|
||||
guint32
|
||||
shell_global_create_pointer_barrier (ShellGlobal *global,
|
||||
int x1, int y1, int x2, int y2,
|
||||
int directions)
|
||||
{
|
||||
#if XFIXES_MAJOR >= 5
|
||||
Display *xdpy;
|
||||
|
||||
xdpy = meta_plugin_get_xdisplay (global->plugin);
|
||||
|
||||
return (guint32)
|
||||
XFixesCreatePointerBarrier (xdpy, DefaultRootWindow(xdpy),
|
||||
x1, y1,
|
||||
x2, y2,
|
||||
directions,
|
||||
0, NULL);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* shell_global_destroy_pointer_barrier
|
||||
* @global: a #ShellGlobal
|
||||
* @barrier: a pointer barrier
|
||||
*
|
||||
* Destroys the @barrier created by shell_global_create_pointer_barrier().
|
||||
*/
|
||||
void
|
||||
shell_global_destroy_pointer_barrier (ShellGlobal *global, guint32 barrier)
|
||||
{
|
||||
#if XFIXES_MAJOR >= 5
|
||||
Display *xdpy;
|
||||
|
||||
g_return_if_fail (barrier > 0);
|
||||
|
||||
xdpy = meta_plugin_get_xdisplay (global->plugin);
|
||||
XFixesDestroyPointerBarrier (xdpy, (PointerBarrier)barrier);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* shell_global_add_extension_importer:
|
||||
* @target_object_script: JavaScript code evaluating to a target object
|
||||
|
Reference in New Issue
Block a user