mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 09:00:42 -05:00
Use meta_core_select_events() for input events
This commit is contained in:
parent
111c23a6e0
commit
3af9de08ab
@ -18,6 +18,7 @@
|
|||||||
#include "meta-background-actor.h"
|
#include "meta-background-actor.h"
|
||||||
#include "window-private.h" /* to check window->hidden */
|
#include "window-private.h" /* to check window->hidden */
|
||||||
#include "display-private.h" /* for meta_display_lookup_x_window() */
|
#include "display-private.h" /* for meta_display_lookup_x_window() */
|
||||||
|
#include "core.h" /* for meta_core_select_events() */
|
||||||
#include "input-events.h"
|
#include "input-events.h"
|
||||||
#include <X11/extensions/shape.h>
|
#include <X11/extensions/shape.h>
|
||||||
#include <X11/extensions/Xcomposite.h>
|
#include <X11/extensions/Xcomposite.h>
|
||||||
@ -179,7 +180,6 @@ get_output_window (MetaScreen *screen)
|
|||||||
MetaDisplay *display = meta_screen_get_display (screen);
|
MetaDisplay *display = meta_screen_get_display (screen);
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||||
Window output, xroot;
|
Window output, xroot;
|
||||||
XWindowAttributes attr;
|
|
||||||
long event_mask;
|
long event_mask;
|
||||||
|
|
||||||
xroot = meta_screen_get_xroot (screen);
|
xroot = meta_screen_get_xroot (screen);
|
||||||
@ -193,13 +193,7 @@ get_output_window (MetaScreen *screen)
|
|||||||
KeyPressMask | KeyReleaseMask;
|
KeyPressMask | KeyReleaseMask;
|
||||||
|
|
||||||
output = XCompositeGetOverlayWindow (xdisplay, xroot);
|
output = XCompositeGetOverlayWindow (xdisplay, xroot);
|
||||||
|
meta_core_select_events (xdisplay, output, event_mask, TRUE);
|
||||||
if (XGetWindowAttributes (xdisplay, output, &attr))
|
|
||||||
{
|
|
||||||
event_mask |= attr.your_event_mask;
|
|
||||||
}
|
|
||||||
|
|
||||||
XSelectInput (xdisplay, output, event_mask);
|
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
@ -474,7 +468,6 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
|
|||||||
Window xroot = meta_screen_get_xroot (screen);
|
Window xroot = meta_screen_get_xroot (screen);
|
||||||
Window xwin;
|
Window xwin;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
XWindowAttributes attr;
|
|
||||||
long event_mask;
|
long event_mask;
|
||||||
guint n_retries;
|
guint n_retries;
|
||||||
guint max_retries;
|
guint max_retries;
|
||||||
@ -549,12 +542,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
|
|||||||
KeyPressMask | KeyReleaseMask |
|
KeyPressMask | KeyReleaseMask |
|
||||||
StructureNotifyMask;
|
StructureNotifyMask;
|
||||||
|
|
||||||
if (XGetWindowAttributes (xdisplay, xwin, &attr))
|
meta_core_select_events (xdisplay, xwin, event_mask, TRUE);
|
||||||
{
|
|
||||||
event_mask |= attr.your_event_mask;
|
|
||||||
}
|
|
||||||
|
|
||||||
XSelectInput (xdisplay, xwin, event_mask);
|
|
||||||
|
|
||||||
info->window_group = meta_window_group_new (screen);
|
info->window_group = meta_window_group_new (screen);
|
||||||
info->background_actor = meta_background_actor_new (screen);
|
info->background_actor = meta_background_actor_new (screen);
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "workspace-private.h"
|
#include "workspace-private.h"
|
||||||
#include "keybindings-private.h"
|
#include "keybindings-private.h"
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
|
#include "core.h"
|
||||||
#include "xprops.h"
|
#include "xprops.h"
|
||||||
#include <meta/compositor.h>
|
#include <meta/compositor.h>
|
||||||
#include "mutter-marshal.h"
|
#include "mutter-marshal.h"
|
||||||
@ -632,7 +633,6 @@ meta_screen_new (MetaDisplay *display,
|
|||||||
MetaScreen *screen;
|
MetaScreen *screen;
|
||||||
Window xroot;
|
Window xroot;
|
||||||
Display *xdisplay;
|
Display *xdisplay;
|
||||||
XWindowAttributes attr;
|
|
||||||
Window new_wm_sn_owner;
|
Window new_wm_sn_owner;
|
||||||
Window current_wm_sn_owner;
|
Window current_wm_sn_owner;
|
||||||
gboolean replace_current_wm;
|
gboolean replace_current_wm;
|
||||||
@ -747,15 +747,15 @@ meta_screen_new (MetaDisplay *display,
|
|||||||
/* We need to or with the existing event mask since
|
/* We need to or with the existing event mask since
|
||||||
* gtk+ may be interested in other events.
|
* gtk+ may be interested in other events.
|
||||||
*/
|
*/
|
||||||
XGetWindowAttributes (xdisplay, xroot, &attr);
|
meta_core_select_events (xdisplay, xroot,
|
||||||
XSelectInput (xdisplay,
|
(SubstructureRedirectMask | SubstructureNotifyMask |
|
||||||
xroot,
|
|
||||||
SubstructureRedirectMask | SubstructureNotifyMask |
|
|
||||||
ColormapChangeMask | PropertyChangeMask |
|
ColormapChangeMask | PropertyChangeMask |
|
||||||
LeaveWindowMask | EnterWindowMask |
|
LeaveWindowMask | EnterWindowMask |
|
||||||
KeyPressMask | KeyReleaseMask |
|
KeyPressMask | KeyReleaseMask |
|
||||||
FocusChangeMask | StructureNotifyMask |
|
FocusChangeMask | StructureNotifyMask |
|
||||||
ExposureMask | attr.your_event_mask);
|
ExposureMask),
|
||||||
|
TRUE);
|
||||||
|
|
||||||
if (meta_error_trap_pop_with_return (display) != Success)
|
if (meta_error_trap_pop_with_return (display) != Success)
|
||||||
{
|
{
|
||||||
meta_warning (_("Screen %d on display \"%s\" already has a window manager\n"),
|
meta_warning (_("Screen %d on display \"%s\" already has a window manager\n"),
|
||||||
@ -941,7 +941,10 @@ meta_screen_free (MetaScreen *screen,
|
|||||||
meta_stack_tracker_free (screen->stack_tracker);
|
meta_stack_tracker_free (screen->stack_tracker);
|
||||||
|
|
||||||
meta_error_trap_push_with_return (screen->display);
|
meta_error_trap_push_with_return (screen->display);
|
||||||
XSelectInput (screen->display->xdisplay, screen->xroot, 0);
|
meta_core_select_events (screen->display->xdisplay,
|
||||||
|
screen->xroot, NoEventMask,
|
||||||
|
FALSE);
|
||||||
|
|
||||||
if (meta_error_trap_pop_with_return (screen->display) != Success)
|
if (meta_error_trap_pop_with_return (screen->display) != Success)
|
||||||
meta_warning (_("Could not release screen %d on display \"%s\"\n"),
|
meta_warning (_("Could not release screen %d on display \"%s\"\n"),
|
||||||
screen->number, screen->display->name);
|
screen->number, screen->display->name);
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include "constraints.h"
|
#include "constraints.h"
|
||||||
#include "input-events.h"
|
#include "input-events.h"
|
||||||
#include "mutter-enum-types.h"
|
#include "mutter-enum-types.h"
|
||||||
|
#include "core.h"
|
||||||
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <X11/Xlibint.h> /* For display->resource_mask */
|
#include <X11/Xlibint.h> /* For display->resource_mask */
|
||||||
@ -781,7 +782,9 @@ meta_window_new_with_attrs (MetaDisplay *display,
|
|||||||
* the event mask, not replace it. For windows from other clients,
|
* the event mask, not replace it. For windows from other clients,
|
||||||
* attrs->your_event_mask will be empty at this point.
|
* attrs->your_event_mask will be empty at this point.
|
||||||
*/
|
*/
|
||||||
XSelectInput (display->xdisplay, xwindow, attrs->your_event_mask | event_mask);
|
meta_core_select_events (display->xdisplay, xwindow,
|
||||||
|
attrs->your_event_mask | event_mask,
|
||||||
|
TRUE);
|
||||||
|
|
||||||
has_shape = FALSE;
|
has_shape = FALSE;
|
||||||
#ifdef HAVE_SHAPE
|
#ifdef HAVE_SHAPE
|
||||||
|
Loading…
Reference in New Issue
Block a user