window/x11: Make process_property_notify a virtual method

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2725>
This commit is contained in:
msizanoen1 2023-02-14 20:26:11 +07:00 committed by Marge Bot
parent dbf3584a9b
commit 899af9d58c
2 changed files with 17 additions and 10 deletions

View File

@ -90,6 +90,10 @@ meta_window_x11_maybe_focus_delayed (MetaWindow *window,
GQueue *other_focus_candidates, GQueue *other_focus_candidates,
guint32 timestamp); guint32 timestamp);
static void
meta_window_x11_impl_process_property_notify (MetaWindow *window,
XPropertyEvent *event);
static void static void
meta_window_x11_init (MetaWindowX11 *window_x11) meta_window_x11_init (MetaWindowX11 *window_x11)
{ {
@ -2229,6 +2233,7 @@ meta_window_x11_class_init (MetaWindowX11Class *klass)
klass->freeze_commits = meta_window_x11_impl_freeze_commits; klass->freeze_commits = meta_window_x11_impl_freeze_commits;
klass->thaw_commits = meta_window_x11_impl_thaw_commits; klass->thaw_commits = meta_window_x11_impl_thaw_commits;
klass->always_update_shape = meta_window_x11_impl_always_update_shape; klass->always_update_shape = meta_window_x11_impl_always_update_shape;
klass->process_property_notify = meta_window_x11_impl_process_property_notify;
obj_props[PROP_ATTRIBUTES] = obj_props[PROP_ATTRIBUTES] =
g_param_spec_pointer ("attributes", g_param_spec_pointer ("attributes",
@ -2933,9 +2938,9 @@ meta_window_x11_configure_request (MetaWindow *window,
return TRUE; return TRUE;
} }
static gboolean static void
process_property_notify (MetaWindow *window, meta_window_x11_impl_process_property_notify (MetaWindow *window,
XPropertyEvent *event) XPropertyEvent *event)
{ {
Window xid = window->xwindow; Window xid = window->xwindow;
@ -2952,19 +2957,19 @@ process_property_notify (MetaWindow *window,
if (event->atom == window->display->x11_display->atom__NET_WM_USER_TIME && if (event->atom == window->display->x11_display->atom__NET_WM_USER_TIME &&
window->user_time_window) window->user_time_window)
{ {
xid = window->user_time_window; xid = window->user_time_window;
} }
meta_window_reload_property_from_xwindow (window, xid, event->atom, FALSE); meta_window_reload_property_from_xwindow (window, xid, event->atom, FALSE);
return TRUE;
} }
gboolean void
meta_window_x11_property_notify (MetaWindow *window, meta_window_x11_property_notify (MetaWindow *window,
XEvent *event) XEvent *event)
{ {
return process_property_notify (window, &event->xproperty); MetaWindowX11Class *klass = META_WINDOW_X11_GET_CLASS (window);
klass->process_property_notify (window, &event->xproperty);
} }
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 #define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0

View File

@ -44,6 +44,8 @@ struct _MetaWindowX11Class
void (*freeze_commits) (MetaWindow *window); void (*freeze_commits) (MetaWindow *window);
void (*thaw_commits) (MetaWindow *window); void (*thaw_commits) (MetaWindow *window);
gboolean (*always_update_shape) (MetaWindow *window); gboolean (*always_update_shape) (MetaWindow *window);
void (*process_property_notify) (MetaWindow *window,
XPropertyEvent *event);
}; };
MetaWindow * meta_window_x11_new (MetaDisplay *display, MetaWindow * meta_window_x11_new (MetaDisplay *display,
@ -71,8 +73,8 @@ void meta_window_x11_recalc_window_type (MetaWindow *window);
gboolean meta_window_x11_configure_request (MetaWindow *window, gboolean meta_window_x11_configure_request (MetaWindow *window,
XEvent *event); XEvent *event);
gboolean meta_window_x11_property_notify (MetaWindow *window, void meta_window_x11_property_notify (MetaWindow *window,
XEvent *event); XEvent *event);
gboolean meta_window_x11_client_message (MetaWindow *window, gboolean meta_window_x11_client_message (MetaWindow *window,
XEvent *event); XEvent *event);