x11/window-controls: Pass around MetaX11Display directly
Instead of passing around an X11 Display pointer that is retrieved from the default Gdk backend, then finding the MetaX11Display from said X11 Display, pass the MetaX11Display directly. https://gitlab.gnome.org/GNOME/mutter/merge_requests/854
This commit is contained in:
parent
da213febdc
commit
e17d70a592
@ -276,12 +276,15 @@ meta_frames_finalize (GObject *object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
queue_recalc_func (gpointer key, gpointer value, gpointer data)
|
queue_recalc_func (gpointer key,
|
||||||
|
gpointer value,
|
||||||
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MetaUIFrame *frame = value;
|
MetaUIFrame *frame = value;
|
||||||
|
MetaFrames *frames = user_data;
|
||||||
|
|
||||||
invalidate_whole_window (frame);
|
invalidate_whole_window (frame);
|
||||||
meta_core_queue_frame_resize (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
meta_x11_wm_queue_frame_resize (frames->x11_display,
|
||||||
frame->xwindow);
|
frame->xwindow);
|
||||||
|
|
||||||
g_clear_object (&frame->text_layout);
|
g_clear_object (&frame->text_layout);
|
||||||
@ -430,13 +433,14 @@ meta_ui_frame_calc_geometry (MetaUIFrame *frame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MetaFrames*
|
MetaFrames*
|
||||||
meta_frames_new (void)
|
meta_frames_new (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
MetaFrames *frames;
|
MetaFrames *frames;
|
||||||
|
|
||||||
frames = g_object_new (META_TYPE_FRAMES,
|
frames = g_object_new (META_TYPE_FRAMES,
|
||||||
"type", GTK_WINDOW_POPUP,
|
"type", GTK_WINDOW_POPUP,
|
||||||
NULL);
|
NULL);
|
||||||
|
frames->x11_display = x11_display;
|
||||||
|
|
||||||
/* Put the window at an arbitrary offscreen location; the one place
|
/* Put the window at an arbitrary offscreen location; the one place
|
||||||
* it can't be is at -100x-100, since the meta_window_new() will
|
* it can't be is at -100x-100, since the meta_window_new() will
|
||||||
@ -523,7 +527,7 @@ meta_frames_manage_window (MetaFrames *frames,
|
|||||||
frame->prelit_control = META_FRAME_CONTROL_NONE;
|
frame->prelit_control = META_FRAME_CONTROL_NONE;
|
||||||
frame->button_state = META_BUTTON_STATE_NORMAL;
|
frame->button_state = META_BUTTON_STATE_NORMAL;
|
||||||
|
|
||||||
meta_core_grab_buttons (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow);
|
meta_x11_wm_grab_buttons (frames->x11_display, frame->xwindow);
|
||||||
|
|
||||||
g_hash_table_replace (frames->frames, &frame->xwindow, frame);
|
g_hash_table_replace (frames->frames, &frame->xwindow, frame);
|
||||||
|
|
||||||
@ -536,7 +540,7 @@ meta_ui_frame_unmanage (MetaUIFrame *frame)
|
|||||||
MetaFrames *frames = frame->frames;
|
MetaFrames *frames = frame->frames;
|
||||||
|
|
||||||
/* restore the cursor */
|
/* restore the cursor */
|
||||||
meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
meta_x11_wm_set_screen_cursor (frames->x11_display,
|
||||||
frame->xwindow,
|
frame->xwindow,
|
||||||
META_CURSOR_DEFAULT);
|
META_CURSOR_DEFAULT);
|
||||||
|
|
||||||
@ -756,14 +760,14 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
|
|||||||
int action)
|
int action)
|
||||||
{
|
{
|
||||||
MetaFrameFlags flags;
|
MetaFrameFlags flags;
|
||||||
Display *display;
|
MetaX11Display *x11_display;
|
||||||
uint32_t evtime;
|
uint32_t evtime;
|
||||||
float x, y;
|
float x, y;
|
||||||
|
|
||||||
g_assert (event->type == CLUTTER_BUTTON_PRESS ||
|
g_assert (event->type == CLUTTER_BUTTON_PRESS ||
|
||||||
event->type == CLUTTER_TOUCH_BEGIN);
|
event->type == CLUTTER_TOUCH_BEGIN);
|
||||||
|
|
||||||
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
x11_display = frame->frames->x11_display;
|
||||||
|
|
||||||
flags = meta_frame_get_flags (frame->meta_window->frame);
|
flags = meta_frame_get_flags (frame->meta_window->frame);
|
||||||
|
|
||||||
@ -788,7 +792,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
|
|||||||
{
|
{
|
||||||
if (flags & META_FRAME_ALLOWS_MAXIMIZE)
|
if (flags & META_FRAME_ALLOWS_MAXIMIZE)
|
||||||
{
|
{
|
||||||
meta_core_toggle_maximize (display, frame->xwindow);
|
meta_x11_wm_toggle_maximize (x11_display, frame->xwindow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -797,7 +801,8 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
|
|||||||
{
|
{
|
||||||
if (flags & META_FRAME_ALLOWS_MAXIMIZE)
|
if (flags & META_FRAME_ALLOWS_MAXIMIZE)
|
||||||
{
|
{
|
||||||
meta_core_toggle_maximize_horizontally (display, frame->xwindow);
|
meta_x11_wm_toggle_maximize_horizontally (x11_display,
|
||||||
|
frame->xwindow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -806,7 +811,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
|
|||||||
{
|
{
|
||||||
if (flags & META_FRAME_ALLOWS_MAXIMIZE)
|
if (flags & META_FRAME_ALLOWS_MAXIMIZE)
|
||||||
{
|
{
|
||||||
meta_core_toggle_maximize_vertically (display, frame->xwindow);
|
meta_x11_wm_toggle_maximize_vertically (x11_display, frame->xwindow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -823,13 +828,13 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case G_DESKTOP_TITLEBAR_ACTION_LOWER:
|
case G_DESKTOP_TITLEBAR_ACTION_LOWER:
|
||||||
meta_core_user_lower_and_unfocus (display,
|
meta_x11_wm_user_lower_and_unfocus (x11_display,
|
||||||
frame->xwindow,
|
frame->xwindow,
|
||||||
evtime);
|
evtime);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case G_DESKTOP_TITLEBAR_ACTION_MENU:
|
case G_DESKTOP_TITLEBAR_ACTION_MENU:
|
||||||
meta_core_show_window_menu (display,
|
meta_x11_wm_show_window_menu (x11_display,
|
||||||
frame->xwindow,
|
frame->xwindow,
|
||||||
META_WINDOW_MENU_WM,
|
META_WINDOW_MENU_WM,
|
||||||
x, y, evtime);
|
x, y, evtime);
|
||||||
@ -876,11 +881,9 @@ meta_frames_try_grab_op (MetaUIFrame *frame,
|
|||||||
guint32 time)
|
guint32 time)
|
||||||
{
|
{
|
||||||
MetaFrames *frames = frame->frames;
|
MetaFrames *frames = frame->frames;
|
||||||
Display *display;
|
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
ret = meta_x11_wm_begin_grab_op (frames->x11_display,
|
||||||
ret = meta_core_begin_grab_op (display,
|
|
||||||
frame->xwindow,
|
frame->xwindow,
|
||||||
op,
|
op,
|
||||||
FALSE,
|
FALSE,
|
||||||
@ -906,7 +909,6 @@ static gboolean
|
|||||||
meta_frames_retry_grab_op (MetaFrames *frames,
|
meta_frames_retry_grab_op (MetaFrames *frames,
|
||||||
guint time)
|
guint time)
|
||||||
{
|
{
|
||||||
Display *display;
|
|
||||||
MetaGrabOp op;
|
MetaGrabOp op;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
@ -915,9 +917,8 @@ meta_frames_retry_grab_op (MetaFrames *frames,
|
|||||||
|
|
||||||
op = frames->current_grab_op;
|
op = frames->current_grab_op;
|
||||||
frames->current_grab_op = META_GRAB_OP_NONE;
|
frames->current_grab_op = META_GRAB_OP_NONE;
|
||||||
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
|
||||||
|
|
||||||
ret = meta_core_begin_grab_op (display,
|
ret = meta_x11_wm_begin_grab_op (frames->x11_display,
|
||||||
frames->grab_frame->xwindow,
|
frames->grab_frame->xwindow,
|
||||||
op,
|
op,
|
||||||
FALSE,
|
FALSE,
|
||||||
@ -1012,7 +1013,7 @@ static gboolean
|
|||||||
meta_frame_left_click_event (MetaUIFrame *frame,
|
meta_frame_left_click_event (MetaUIFrame *frame,
|
||||||
const ClutterEvent *event)
|
const ClutterEvent *event)
|
||||||
{
|
{
|
||||||
Display *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
MetaX11Display *x11_display = frame->frames->x11_display;
|
||||||
MetaFrameControl control;
|
MetaFrameControl control;
|
||||||
guint32 evtime;
|
guint32 evtime;
|
||||||
gfloat x, y;
|
gfloat x, y;
|
||||||
@ -1056,7 +1057,7 @@ meta_frame_left_click_event (MetaUIFrame *frame,
|
|||||||
* button state while the menu is open
|
* button state while the menu is open
|
||||||
*/
|
*/
|
||||||
frame->maybe_ignore_leave_notify = TRUE;
|
frame->maybe_ignore_leave_notify = TRUE;
|
||||||
meta_core_show_window_menu_for_rect (display,
|
meta_x11_wm_show_window_menu_for_rect (x11_display,
|
||||||
frame->xwindow,
|
frame->xwindow,
|
||||||
META_WINDOW_MENU_WM,
|
META_WINDOW_MENU_WM,
|
||||||
&root_rect,
|
&root_rect,
|
||||||
@ -1111,7 +1112,6 @@ handle_press_event (MetaUIFrame *frame,
|
|||||||
const ClutterEvent *event)
|
const ClutterEvent *event)
|
||||||
{
|
{
|
||||||
MetaFrameControl control;
|
MetaFrameControl control;
|
||||||
Display *display;
|
|
||||||
uint32_t evtime, action;
|
uint32_t evtime, action;
|
||||||
float x, y;
|
float x, y;
|
||||||
|
|
||||||
@ -1122,8 +1122,6 @@ handle_press_event (MetaUIFrame *frame,
|
|||||||
if (action == META_ACTION_IGNORE)
|
if (action == META_ACTION_IGNORE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
|
||||||
|
|
||||||
evtime = clutter_event_get_time (event);
|
evtime = clutter_event_get_time (event);
|
||||||
clutter_event_get_coords (event, &x, &y);
|
clutter_event_get_coords (event, &x, &y);
|
||||||
control = get_control (frame, x, y);
|
control = get_control (frame, x, y);
|
||||||
@ -1148,11 +1146,11 @@ handle_press_event (MetaUIFrame *frame,
|
|||||||
if (control == META_FRAME_CONTROL_TITLE &&
|
if (control == META_FRAME_CONTROL_TITLE &&
|
||||||
action == META_ACTION_DOUBLE_CLICK)
|
action == META_ACTION_DOUBLE_CLICK)
|
||||||
{
|
{
|
||||||
meta_core_end_grab_op (display, evtime);
|
meta_x11_wm_end_grab_op (frame->frames->x11_display, evtime);
|
||||||
return meta_frame_double_click_event (frame, event);
|
return meta_frame_double_click_event (frame, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (meta_core_get_grab_op (display) != META_GRAB_OP_NONE)
|
if (meta_x11_wm_get_grab_op (frame->frames->x11_display) != META_GRAB_OP_NONE)
|
||||||
return FALSE; /* already up to something */
|
return FALSE; /* already up to something */
|
||||||
|
|
||||||
frame->grab_button = get_button_number (event);
|
frame->grab_button = get_button_number (event);
|
||||||
@ -1174,7 +1172,6 @@ static gboolean
|
|||||||
handle_release_event (MetaUIFrame *frame,
|
handle_release_event (MetaUIFrame *frame,
|
||||||
const ClutterEvent *event)
|
const ClutterEvent *event)
|
||||||
{
|
{
|
||||||
Display *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
|
||||||
guint32 evtime, button;
|
guint32 evtime, button;
|
||||||
gfloat x, y;
|
gfloat x, y;
|
||||||
|
|
||||||
@ -1186,7 +1183,7 @@ handle_release_event (MetaUIFrame *frame,
|
|||||||
button = get_button_number (event);
|
button = get_button_number (event);
|
||||||
|
|
||||||
frame->frames->current_grab_op = META_GRAB_OP_NONE;
|
frame->frames->current_grab_op = META_GRAB_OP_NONE;
|
||||||
meta_core_end_grab_op (display, evtime);
|
meta_x11_wm_end_grab_op (frame->frames->x11_display, evtime);
|
||||||
|
|
||||||
/* We only handle the releases we handled the presses for (things
|
/* We only handle the releases we handled the presses for (things
|
||||||
* involving frame controls). Window ops that don't require a
|
* involving frame controls). Window ops that don't require a
|
||||||
@ -1288,7 +1285,7 @@ meta_ui_frame_update_prelit_control (MetaUIFrame *frame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set/unset the prelight cursor */
|
/* set/unset the prelight cursor */
|
||||||
meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
meta_x11_wm_set_screen_cursor (frame->frames->x11_display,
|
||||||
frame->xwindow,
|
frame->xwindow,
|
||||||
cursor);
|
cursor);
|
||||||
|
|
||||||
@ -1586,11 +1583,9 @@ static gboolean
|
|||||||
handle_leave_notify_event (MetaUIFrame *frame,
|
handle_leave_notify_event (MetaUIFrame *frame,
|
||||||
ClutterCrossingEvent *event)
|
ClutterCrossingEvent *event)
|
||||||
{
|
{
|
||||||
Display *display;
|
|
||||||
MetaGrabOp grab_op;
|
MetaGrabOp grab_op;
|
||||||
|
|
||||||
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
grab_op = meta_x11_wm_get_grab_op (frame->frames->x11_display);
|
||||||
grab_op = meta_core_get_grab_op (display);
|
|
||||||
|
|
||||||
/* ignore the first LeaveNotify event after opening a window menu
|
/* ignore the first LeaveNotify event after opening a window menu
|
||||||
* if it is the result of a compositor grab
|
* if it is the result of a compositor grab
|
||||||
|
@ -87,6 +87,8 @@ struct _MetaFrames
|
|||||||
{
|
{
|
||||||
GtkWindow parent_instance;
|
GtkWindow parent_instance;
|
||||||
|
|
||||||
|
MetaX11Display *x11_display;
|
||||||
|
|
||||||
GHashTable *text_heights;
|
GHashTable *text_heights;
|
||||||
|
|
||||||
GHashTable *frames;
|
GHashTable *frames;
|
||||||
@ -111,7 +113,7 @@ struct _MetaFramesClass
|
|||||||
|
|
||||||
GType meta_frames_get_type (void) G_GNUC_CONST;
|
GType meta_frames_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
MetaFrames *meta_frames_new (void);
|
MetaFrames * meta_frames_new (MetaX11Display *x11_display);
|
||||||
|
|
||||||
MetaUIFrame * meta_frames_manage_window (MetaFrames *frames,
|
MetaUIFrame * meta_frames_manage_window (MetaFrames *frames,
|
||||||
MetaWindow *meta_window,
|
MetaWindow *meta_window,
|
||||||
|
@ -59,7 +59,7 @@ meta_ui_new (MetaX11Display *x11_display)
|
|||||||
ui = g_new0 (MetaUI, 1);
|
ui = g_new0 (MetaUI, 1);
|
||||||
ui->xdisplay = x11_display->xdisplay;
|
ui->xdisplay = x11_display->xdisplay;
|
||||||
|
|
||||||
ui->frames = meta_frames_new ();
|
ui->frames = meta_frames_new (x11_display);
|
||||||
/* GTK+ needs the frame-sync protocol to work in order to properly
|
/* GTK+ needs the frame-sync protocol to work in order to properly
|
||||||
* handle style changes. This means that the dummy widget we create
|
* handle style changes. This means that the dummy widget we create
|
||||||
* to get the style for title bars actually needs to be mapped
|
* to get the style for title bars actually needs to be mapped
|
||||||
|
@ -253,6 +253,8 @@ void meta_x11_display_set_input_focus (MetaX11Display *x11_display,
|
|||||||
gboolean focus_frame,
|
gboolean focus_frame,
|
||||||
uint32_t timestamp);
|
uint32_t timestamp);
|
||||||
|
|
||||||
|
MetaDisplay * meta_x11_display_get_display (MetaX11Display *x11_display);
|
||||||
|
|
||||||
const gchar * meta_x11_get_display_name (void);
|
const gchar * meta_x11_get_display_name (void);
|
||||||
|
|
||||||
#endif /* META_X11_DISPLAY_PRIVATE_H */
|
#endif /* META_X11_DISPLAY_PRIVATE_H */
|
||||||
|
@ -1407,6 +1407,12 @@ meta_x11_display_get_screen_number (MetaX11Display *x11_display)
|
|||||||
return DefaultScreen (x11_display->xdisplay);
|
return DefaultScreen (x11_display->xdisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MetaDisplay *
|
||||||
|
meta_x11_display_get_display (MetaX11Display *x11_display)
|
||||||
|
{
|
||||||
|
return x11_display->display;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_x11_display_get_xdisplay: (skip)
|
* meta_x11_display_get_xdisplay: (skip)
|
||||||
* @x11_display: a #MetaX11Display
|
* @x11_display: a #MetaX11Display
|
||||||
|
@ -35,28 +35,14 @@
|
|||||||
#include "x11/window-x11-private.h"
|
#include "x11/window-x11-private.h"
|
||||||
#include "x11/window-x11.h"
|
#include "x11/window-x11.h"
|
||||||
|
|
||||||
/* Looks up the MetaWindow representing the frame of the given X window.
|
|
||||||
* Used as a helper function by a bunch of the functions below.
|
|
||||||
*
|
|
||||||
* FIXME: The functions that use this function throw the result away
|
|
||||||
* after use. Many of these functions tend to be called in small groups,
|
|
||||||
* which results in get_window() getting called several times in succession
|
|
||||||
* with the same parameters. We should profile to see whether this wastes
|
|
||||||
* much time, and if it does we should look into a generalised
|
|
||||||
* meta_core_get_window_info() which takes a bunch of pointers to variables
|
|
||||||
* to put its results in, and only fills in the non-null ones.
|
|
||||||
*/
|
|
||||||
static MetaWindow *
|
static MetaWindow *
|
||||||
get_window (Display *xdisplay,
|
window_from_frame (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow)
|
Window frame_xwindow)
|
||||||
{
|
{
|
||||||
MetaDisplay *display;
|
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
|
||||||
display = meta_display_for_x_display (xdisplay);
|
window = meta_x11_display_lookup_x_window (x11_display, frame_xwindow);
|
||||||
window = meta_x11_display_lookup_x_window (display->x11_display, frame_xwindow);
|
if (!window || !window->frame)
|
||||||
|
|
||||||
if (window == NULL || window->frame == NULL)
|
|
||||||
{
|
{
|
||||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -66,10 +52,10 @@ get_window (Display *xdisplay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_core_queue_frame_resize (Display *xdisplay,
|
meta_x11_wm_queue_frame_resize (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow)
|
Window frame_xwindow)
|
||||||
{
|
{
|
||||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
MetaWindow *window = window_from_frame (x11_display, frame_xwindow);
|
||||||
|
|
||||||
meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
|
meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
|
||||||
meta_window_frame_size_changed (window);
|
meta_window_frame_size_changed (window);
|
||||||
@ -115,11 +101,11 @@ lower_window_and_transients (MetaWindow *window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_core_user_lower_and_unfocus (Display *xdisplay,
|
meta_x11_wm_user_lower_and_unfocus (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow,
|
Window frame_xwindow,
|
||||||
guint32 timestamp)
|
uint32_t timestamp)
|
||||||
{
|
{
|
||||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
MetaWindow *window = window_from_frame (x11_display, frame_xwindow);
|
||||||
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
|
|
||||||
lower_window_and_transients (window, NULL);
|
lower_window_and_transients (window, NULL);
|
||||||
@ -134,10 +120,10 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_core_toggle_maximize_vertically (Display *xdisplay,
|
meta_x11_wm_toggle_maximize_vertically (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow)
|
Window frame_xwindow)
|
||||||
{
|
{
|
||||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
MetaWindow *window = window_from_frame (x11_display, frame_xwindow);
|
||||||
|
|
||||||
if (meta_prefs_get_raise_on_click ())
|
if (meta_prefs_get_raise_on_click ())
|
||||||
meta_window_raise (window);
|
meta_window_raise (window);
|
||||||
@ -149,10 +135,10 @@ meta_core_toggle_maximize_vertically (Display *xdisplay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_core_toggle_maximize_horizontally (Display *xdisplay,
|
meta_x11_wm_toggle_maximize_horizontally (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow)
|
Window frame_xwindow)
|
||||||
{
|
{
|
||||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
MetaWindow *window = window_from_frame (x11_display, frame_xwindow);
|
||||||
|
|
||||||
if (meta_prefs_get_raise_on_click ())
|
if (meta_prefs_get_raise_on_click ())
|
||||||
meta_window_raise (window);
|
meta_window_raise (window);
|
||||||
@ -164,10 +150,10 @@ meta_core_toggle_maximize_horizontally (Display *xdisplay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_core_toggle_maximize (Display *xdisplay,
|
meta_x11_wm_toggle_maximize (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow)
|
Window frame_xwindow)
|
||||||
{
|
{
|
||||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
MetaWindow *window = window_from_frame (x11_display, frame_xwindow);
|
||||||
|
|
||||||
if (meta_prefs_get_raise_on_click ())
|
if (meta_prefs_get_raise_on_click ())
|
||||||
meta_window_raise (window);
|
meta_window_raise (window);
|
||||||
@ -179,14 +165,14 @@ meta_core_toggle_maximize (Display *xdisplay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_core_show_window_menu (Display *xdisplay,
|
meta_x11_wm_show_window_menu (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow,
|
Window frame_xwindow,
|
||||||
MetaWindowMenuType menu,
|
MetaWindowMenuType menu,
|
||||||
int root_x,
|
int root_x,
|
||||||
int root_y,
|
int root_y,
|
||||||
guint32 timestamp)
|
uint32_t timestamp)
|
||||||
{
|
{
|
||||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
MetaWindow *window = window_from_frame (x11_display, frame_xwindow);
|
||||||
|
|
||||||
if (meta_prefs_get_raise_on_click ())
|
if (meta_prefs_get_raise_on_click ())
|
||||||
meta_window_raise (window);
|
meta_window_raise (window);
|
||||||
@ -196,13 +182,13 @@ meta_core_show_window_menu (Display *xdisplay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_core_show_window_menu_for_rect (Display *xdisplay,
|
meta_x11_wm_show_window_menu_for_rect (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow,
|
Window frame_xwindow,
|
||||||
MetaWindowMenuType menu,
|
MetaWindowMenuType menu,
|
||||||
MetaRectangle *rect,
|
MetaRectangle *rect,
|
||||||
guint32 timestamp)
|
uint32_t timestamp)
|
||||||
{
|
{
|
||||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
MetaWindow *window = window_from_frame (x11_display, frame_xwindow);
|
||||||
|
|
||||||
if (meta_prefs_get_raise_on_click ())
|
if (meta_prefs_get_raise_on_click ())
|
||||||
meta_window_raise (window);
|
meta_window_raise (window);
|
||||||
@ -212,21 +198,21 @@ meta_core_show_window_menu_for_rect (Display *xdisplay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_core_begin_grab_op (Display *xdisplay,
|
meta_x11_wm_begin_grab_op (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow,
|
Window frame_xwindow,
|
||||||
MetaGrabOp op,
|
MetaGrabOp op,
|
||||||
gboolean pointer_already_grabbed,
|
gboolean pointer_already_grabbed,
|
||||||
gboolean frame_action,
|
gboolean frame_action,
|
||||||
int button,
|
int button,
|
||||||
gulong modmask,
|
gulong modmask,
|
||||||
guint32 timestamp,
|
uint32_t timestamp,
|
||||||
int root_x,
|
int root_x,
|
||||||
int root_y)
|
int root_y)
|
||||||
{
|
{
|
||||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
MetaWindow *window = window_from_frame (x11_display, frame_xwindow);
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
|
|
||||||
display = meta_display_for_x_display (xdisplay);
|
display = meta_x11_display_get_display (x11_display);
|
||||||
|
|
||||||
return meta_display_begin_grab_op (display, window,
|
return meta_display_begin_grab_op (display, window,
|
||||||
op, pointer_already_grabbed,
|
op, pointer_already_grabbed,
|
||||||
@ -236,44 +222,44 @@ meta_core_begin_grab_op (Display *xdisplay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_core_end_grab_op (Display *xdisplay,
|
meta_x11_wm_end_grab_op (MetaX11Display *x11_display,
|
||||||
guint32 timestamp)
|
uint32_t timestamp)
|
||||||
{
|
{
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
|
|
||||||
display = meta_display_for_x_display (xdisplay);
|
display = meta_x11_display_get_display (x11_display);
|
||||||
|
|
||||||
meta_display_end_grab_op (display, timestamp);
|
meta_display_end_grab_op (display, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaGrabOp
|
MetaGrabOp
|
||||||
meta_core_get_grab_op (Display *xdisplay)
|
meta_x11_wm_get_grab_op (MetaX11Display *x11_display)
|
||||||
{
|
{
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
|
|
||||||
display = meta_display_for_x_display (xdisplay);
|
display = meta_x11_display_get_display (x11_display);
|
||||||
|
|
||||||
return display->grab_op;
|
return display->grab_op;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_core_grab_buttons (Display *xdisplay,
|
meta_x11_wm_grab_buttons (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow)
|
Window frame_xwindow)
|
||||||
{
|
{
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
|
|
||||||
display = meta_display_for_x_display (xdisplay);
|
display = meta_x11_display_get_display (x11_display);
|
||||||
|
|
||||||
meta_verbose ("Grabbing buttons on frame 0x%lx\n", frame_xwindow);
|
meta_verbose ("Grabbing buttons on frame 0x%lx\n", frame_xwindow);
|
||||||
meta_display_grab_window_buttons (display, frame_xwindow);
|
meta_display_grab_window_buttons (display, frame_xwindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_core_set_screen_cursor (Display *xdisplay,
|
meta_x11_wm_set_screen_cursor (MetaX11Display *x11_display,
|
||||||
Window frame_on_screen,
|
Window frame_on_screen,
|
||||||
MetaCursor cursor)
|
MetaCursor cursor)
|
||||||
{
|
{
|
||||||
MetaWindow *window = get_window (xdisplay, frame_on_screen);
|
MetaWindow *window = window_from_frame (x11_display, frame_on_screen);
|
||||||
|
|
||||||
meta_frame_set_screen_cursor (window->frame, cursor);
|
meta_frame_set_screen_cursor (window->frame, cursor);
|
||||||
}
|
}
|
||||||
|
@ -27,53 +27,54 @@
|
|||||||
|
|
||||||
#include "meta/boxes.h"
|
#include "meta/boxes.h"
|
||||||
#include "meta/common.h"
|
#include "meta/common.h"
|
||||||
|
#include "x11/meta-x11-display-private.h"
|
||||||
|
|
||||||
void meta_core_queue_frame_resize (Display *xdisplay,
|
void meta_x11_wm_queue_frame_resize (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow);
|
Window frame_xwindow);
|
||||||
|
|
||||||
void meta_core_user_lower_and_unfocus (Display *xdisplay,
|
void meta_x11_wm_user_lower_and_unfocus (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow,
|
Window frame_xwindow,
|
||||||
guint32 timestamp);
|
uint32_t timestamp);
|
||||||
|
|
||||||
void meta_core_toggle_maximize (Display *xdisplay,
|
void meta_x11_wm_toggle_maximize (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow);
|
Window frame_xwindow);
|
||||||
void meta_core_toggle_maximize_horizontally (Display *xdisplay,
|
void meta_x11_wm_toggle_maximize_horizontally (MetaX11Display *xdisplay,
|
||||||
Window frame_xwindow);
|
Window frame_xwindow);
|
||||||
void meta_core_toggle_maximize_vertically (Display *xdisplay,
|
void meta_x11_wm_toggle_maximize_vertically (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow);
|
Window frame_xwindow);
|
||||||
|
|
||||||
void meta_core_show_window_menu (Display *xdisplay,
|
void meta_x11_wm_show_window_menu (MetaX11Display *x11_xdisplay,
|
||||||
Window frame_xwindow,
|
Window frame_xwindow,
|
||||||
MetaWindowMenuType menu,
|
MetaWindowMenuType menu,
|
||||||
int root_x,
|
int root_x,
|
||||||
int root_y,
|
int root_y,
|
||||||
guint32 timestamp);
|
uint32_t timestamp);
|
||||||
|
|
||||||
void meta_core_show_window_menu_for_rect (Display *xdisplay,
|
void meta_x11_wm_show_window_menu_for_rect (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow,
|
Window frame_xwindow,
|
||||||
MetaWindowMenuType menu,
|
MetaWindowMenuType menu,
|
||||||
MetaRectangle *rect,
|
MetaRectangle *rect,
|
||||||
guint32 timestamp);
|
uint32_t timestamp);
|
||||||
|
|
||||||
gboolean meta_core_begin_grab_op (Display *xdisplay,
|
gboolean meta_x11_wm_begin_grab_op (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow,
|
Window frame_xwindow,
|
||||||
MetaGrabOp op,
|
MetaGrabOp op,
|
||||||
gboolean pointer_already_grabbed,
|
gboolean pointer_already_grabbed,
|
||||||
gboolean frame_action,
|
gboolean frame_action,
|
||||||
int button,
|
int button,
|
||||||
gulong modmask,
|
gulong modmask,
|
||||||
guint32 timestamp,
|
uint32_t timestamp,
|
||||||
int root_x,
|
int root_x,
|
||||||
int root_y);
|
int root_y);
|
||||||
void meta_core_end_grab_op (Display *xdisplay,
|
void meta_x11_wm_end_grab_op (MetaX11Display *x11_display,
|
||||||
guint32 timestamp);
|
uint32_t timestamp);
|
||||||
MetaGrabOp meta_core_get_grab_op (Display *xdisplay);
|
MetaGrabOp meta_x11_wm_get_grab_op (MetaX11Display *x11_display);
|
||||||
|
|
||||||
|
|
||||||
void meta_core_grab_buttons (Display *xdisplay,
|
void meta_x11_wm_grab_buttons (MetaX11Display *x11_display,
|
||||||
Window frame_xwindow);
|
Window frame_xwindow);
|
||||||
|
|
||||||
void meta_core_set_screen_cursor (Display *xdisplay,
|
void meta_x11_wm_set_screen_cursor (MetaX11Display *x11_display,
|
||||||
Window frame_on_screen,
|
Window frame_on_screen,
|
||||||
MetaCursor cursor);
|
MetaCursor cursor);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user