[mutter/wip/ui-on-own-connection: 10/13] ui: Remove Display from the UI API
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/ui-on-own-connection: 10/13] ui: Remove Display from the UI API
- Date: Mon, 7 Apr 2014 12:29:52 +0000 (UTC)
commit 29f6e3bda5fbaa5d4365d73a240d520c5af9583c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Apr 6 17:39:24 2014 -0400
ui: Remove Display from the UI API
We already store it in the MetaUI struct, so add that where it's
missing and remove Display.
src/core/events.c | 5 +++--
src/core/frame.c | 1 -
src/ui/ui.c | 11 +++++------
src/ui/ui.h | 5 ++---
4 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/src/core/events.c b/src/core/events.c
index 97adfc4..6016766 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -1814,8 +1814,9 @@ meta_display_handle_xevent (MetaDisplay *display,
if (event->type == UnmapNotify)
{
- if (meta_ui_window_should_not_cause_focus (display->xdisplay,
- modified))
+ MetaUI *ui = display->screen->ui;
+
+ if (meta_ui_window_should_not_cause_focus (ui, modified))
{
meta_display_add_ignored_crossing_serial (display, event->xany.serial);
meta_topic (META_DEBUG_FOCUS,
diff --git a/src/core/frame.c b/src/core/frame.c
index 350493c..bf53afb 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -92,7 +92,6 @@ meta_window_ensure_frame (MetaWindow *window)
visual = NULL;
frame->xwindow = meta_ui_create_frame_window (window->screen->ui,
- window->display->xdisplay,
visual,
frame->rect.x,
frame->rect.y,
diff --git a/src/ui/ui.c b/src/ui/ui.c
index 5b60927..e12731c 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -293,7 +293,6 @@ meta_ui_get_frame_borders (MetaUI *ui,
Window
meta_ui_create_frame_window (MetaUI *ui,
- Display *xdisplay,
Visual *xvisual,
gint x,
gint y,
@@ -302,7 +301,7 @@ meta_ui_create_frame_window (MetaUI *ui,
gint screen_no,
gulong *create_serial)
{
- GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay);
+ GdkDisplay *display = gdk_x11_lookup_xdisplay (ui->xdisplay);
GdkScreen *screen = gdk_display_get_screen (display, screen_no);
GdkWindowAttr attrs;
gint attributes_mask;
@@ -351,7 +350,7 @@ meta_ui_create_frame_window (MetaUI *ui,
* as long as you pass in a colormap.
*/
if (create_serial)
- *create_serial = XNextRequest (xdisplay);
+ *create_serial = XNextRequest (GDK_DISPLAY_XDISPLAY (display));
window =
gdk_window_new (gdk_screen_get_root_window(screen),
&attrs, attributes_mask);
@@ -620,13 +619,13 @@ meta_ui_get_default_mini_icon (MetaUI *ui)
}
gboolean
-meta_ui_window_should_not_cause_focus (Display *xdisplay,
- Window xwindow)
+meta_ui_window_should_not_cause_focus (MetaUI *ui,
+ Window xwindow)
{
GdkWindow *window;
GdkDisplay *display;
- display = gdk_x11_lookup_xdisplay (xdisplay);
+ display = gdk_x11_lookup_xdisplay (display->xdisplay);
window = gdk_x11_window_lookup_for_display (display, xwindow);
/* we shouldn't cause focus if we're an override redirect
diff --git a/src/ui/ui.h b/src/ui/ui.h
index e59c0b5..4599d61 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -63,7 +63,6 @@ void meta_ui_get_frame_mask (MetaUI *ui,
cairo_t *cr);
Window meta_ui_create_frame_window (MetaUI *ui,
- Display *xdisplay,
Visual *xvisual,
gint x,
gint y,
@@ -137,8 +136,8 @@ GdkPixbuf* meta_gdk_pixbuf_get_from_pixmap (Pixmap xpixmap,
GdkPixbuf* meta_ui_get_default_window_icon (MetaUI *ui);
GdkPixbuf* meta_ui_get_default_mini_icon (MetaUI *ui);
-gboolean meta_ui_window_should_not_cause_focus (Display *xdisplay,
- Window xwindow);
+gboolean meta_ui_window_should_not_cause_focus (MetaUI *ui,
+ Window xwindow);
void meta_ui_set_current_theme (const char *name);
gboolean meta_ui_have_a_theme (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]