mirror of
https://github.com/brl/mutter.git
synced 2025-02-22 07:54:09 +00:00
ui: Store the GdkDisplay / GdkScreen internally
We're going to get the defaults instead of passing them through soon.
This commit is contained in:
parent
29f6e3bda5
commit
4122257bce
36
src/ui/ui.c
36
src/ui/ui.c
@ -39,8 +39,9 @@ static void meta_ui_accelerator_parse (const char *accel,
|
|||||||
|
|
||||||
struct _MetaUI
|
struct _MetaUI
|
||||||
{
|
{
|
||||||
Display *xdisplay;
|
GdkDisplay *display;
|
||||||
Screen *xscreen;
|
GdkScreen *screen;
|
||||||
|
|
||||||
MetaFrames *frames;
|
MetaFrames *frames;
|
||||||
|
|
||||||
/* For double-click tracking */
|
/* For double-click tracking */
|
||||||
@ -107,9 +108,6 @@ maybe_redirect_mouse_event (MetaUI *ui,
|
|||||||
XIDeviceEvent *xev_d = NULL;
|
XIDeviceEvent *xev_d = NULL;
|
||||||
XIEnterEvent *xev_e = NULL;
|
XIEnterEvent *xev_e = NULL;
|
||||||
|
|
||||||
if (xev->display != ui->xdisplay)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (!is_input_event (xevent))
|
if (!is_input_event (xevent))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@ -132,7 +130,7 @@ maybe_redirect_mouse_event (MetaUI *ui,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gdisplay = gdk_x11_lookup_xdisplay (xev->display);
|
gdisplay = ui->display;
|
||||||
gdk_window = gdk_x11_window_lookup_for_display (gdisplay, window);
|
gdk_window = gdk_x11_window_lookup_for_display (gdisplay, window);
|
||||||
if (gdk_window == NULL)
|
if (gdk_window == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -241,14 +239,14 @@ meta_ui_new (Display *xdisplay,
|
|||||||
GdkDisplay *gdisplay;
|
GdkDisplay *gdisplay;
|
||||||
MetaUI *ui;
|
MetaUI *ui;
|
||||||
|
|
||||||
ui = g_new0 (MetaUI, 1);
|
|
||||||
ui->xdisplay = xdisplay;
|
|
||||||
ui->xscreen = screen;
|
|
||||||
|
|
||||||
gdisplay = gdk_x11_lookup_xdisplay (xdisplay);
|
gdisplay = gdk_x11_lookup_xdisplay (xdisplay);
|
||||||
g_assert (gdisplay == gdk_display_get_default ());
|
g_assert (gdisplay == gdk_display_get_default ());
|
||||||
|
|
||||||
ui->frames = meta_frames_new (XScreenNumberOfScreen (screen));
|
ui = g_new0 (MetaUI, 1);
|
||||||
|
ui->display = gdisplay;
|
||||||
|
ui->screen = gdk_display_get_screen (gdisplay, XScreenNumberOfScreen (screen));
|
||||||
|
|
||||||
|
ui->frames = meta_frames_new (gdk_screen_get_number (ui->screen));
|
||||||
/* 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
|
||||||
@ -301,7 +299,7 @@ meta_ui_create_frame_window (MetaUI *ui,
|
|||||||
gint screen_no,
|
gint screen_no,
|
||||||
gulong *create_serial)
|
gulong *create_serial)
|
||||||
{
|
{
|
||||||
GdkDisplay *display = gdk_x11_lookup_xdisplay (ui->xdisplay);
|
GdkDisplay *display = ui->display;
|
||||||
GdkScreen *screen = gdk_display_get_screen (display, screen_no);
|
GdkScreen *screen = gdk_display_get_screen (display, screen_no);
|
||||||
GdkWindowAttr attrs;
|
GdkWindowAttr attrs;
|
||||||
gint attributes_mask;
|
gint attributes_mask;
|
||||||
@ -384,10 +382,9 @@ void
|
|||||||
meta_ui_map_frame (MetaUI *ui,
|
meta_ui_map_frame (MetaUI *ui,
|
||||||
Window xwindow)
|
Window xwindow)
|
||||||
{
|
{
|
||||||
|
GdkDisplay *display = ui->display;
|
||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
GdkDisplay *display;
|
|
||||||
|
|
||||||
display = gdk_x11_lookup_xdisplay (ui->xdisplay);
|
|
||||||
window = gdk_x11_window_lookup_for_display (display, xwindow);
|
window = gdk_x11_window_lookup_for_display (display, xwindow);
|
||||||
|
|
||||||
if (window)
|
if (window)
|
||||||
@ -398,10 +395,9 @@ void
|
|||||||
meta_ui_unmap_frame (MetaUI *ui,
|
meta_ui_unmap_frame (MetaUI *ui,
|
||||||
Window xwindow)
|
Window xwindow)
|
||||||
{
|
{
|
||||||
|
GdkDisplay *display = ui->display;
|
||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
GdkDisplay *display;
|
|
||||||
|
|
||||||
display = gdk_x11_lookup_xdisplay (ui->xdisplay);
|
|
||||||
window = gdk_x11_window_lookup_for_display (display, xwindow);
|
window = gdk_x11_window_lookup_for_display (display, xwindow);
|
||||||
|
|
||||||
if (window)
|
if (window)
|
||||||
@ -625,7 +621,7 @@ meta_ui_window_should_not_cause_focus (MetaUI *ui,
|
|||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
|
|
||||||
display = gdk_x11_lookup_xdisplay (display->xdisplay);
|
display = ui->display;
|
||||||
window = gdk_x11_window_lookup_for_display (display, xwindow);
|
window = gdk_x11_window_lookup_for_display (display, xwindow);
|
||||||
|
|
||||||
/* we shouldn't cause focus if we're an override redirect
|
/* we shouldn't cause focus if we're an override redirect
|
||||||
@ -656,8 +652,7 @@ meta_ui_theme_get_frame_borders (MetaUI *ui,
|
|||||||
|
|
||||||
if (!font_desc)
|
if (!font_desc)
|
||||||
{
|
{
|
||||||
GdkDisplay *display = gdk_x11_lookup_xdisplay (ui->xdisplay);
|
GdkScreen *screen = ui->screen;
|
||||||
GdkScreen *screen = gdk_display_get_screen (display, XScreenNumberOfScreen (ui->xscreen));
|
|
||||||
GtkWidgetPath *widget_path;
|
GtkWidgetPath *widget_path;
|
||||||
|
|
||||||
style = gtk_style_context_new ();
|
style = gtk_style_context_new ();
|
||||||
@ -896,10 +891,9 @@ gboolean
|
|||||||
meta_ui_window_is_widget (MetaUI *ui,
|
meta_ui_window_is_widget (MetaUI *ui,
|
||||||
Window xwindow)
|
Window xwindow)
|
||||||
{
|
{
|
||||||
GdkDisplay *display;
|
GdkDisplay *display = ui->display;
|
||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
|
|
||||||
display = gdk_x11_lookup_xdisplay (ui->xdisplay);
|
|
||||||
window = gdk_x11_window_lookup_for_display (display, xwindow);
|
window = gdk_x11_window_lookup_for_display (display, xwindow);
|
||||||
|
|
||||||
if (window)
|
if (window)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user