summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-07-29 02:10:08 +0200
committerZenWalker <[email protected]>2017-07-29 02:10:08 +0200
commited1a6302c87c6070bbec549ec36c5b56c12a6564 (patch)
tree1e5042d3a0e8159065360af12d9f9467d6f5f134 /src/ui
parentc3ab92182c2a97d74c5b8cbd6dade9b48fab5c95 (diff)
downloadmarco-ed1a6302c87c6070bbec549ec36c5b56c12a6564.tar.bz2
marco-ed1a6302c87c6070bbec549ec36c5b56c12a6564.tar.xz
avoid deprecated gdk_display_get_screen
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/fixedtip.c5
-rw-r--r--src/ui/fixedtip.h3
-rw-r--r--src/ui/frames.c11
-rw-r--r--src/ui/frames.h2
-rw-r--r--src/ui/resizepopup.c3
-rw-r--r--src/ui/tabpopup.c4
-rw-r--r--src/ui/tile-preview.c4
-rw-r--r--src/ui/ui.c9
8 files changed, 15 insertions, 26 deletions
diff --git a/src/ui/fixedtip.c b/src/ui/fixedtip.c
index 7de93d9b..688f5f1d 100644
--- a/src/ui/fixedtip.c
+++ b/src/ui/fixedtip.c
@@ -62,8 +62,7 @@ draw_handler (GtkWidget *widget,
}
void
-meta_fixed_tip_show (int screen_number,
- int root_x, int root_y,
+meta_fixed_tip_show (int root_x, int root_y,
const char *markup_text)
{
gint w;
@@ -82,7 +81,7 @@ meta_fixed_tip_show (int screen_number,
gtk_style_context_add_class (gtk_widget_get_style_context (tip),
GTK_STYLE_CLASS_TOOLTIP);
- screen = gdk_display_get_screen (gdk_display_get_default (), screen_number);
+ screen = gdk_display_get_default_screen (gdk_display_get_default ());
visual = gdk_screen_get_rgba_visual (screen);
gtk_window_set_screen (GTK_WINDOW (tip), screen);
diff --git a/src/ui/fixedtip.h b/src/ui/fixedtip.h
index c108df92..9a7dd78b 100644
--- a/src/ui/fixedtip.h
+++ b/src/ui/fixedtip.h
@@ -51,8 +51,7 @@
* \param root_y The Y coordinate where the tooltip should appear
* \param markup_text Text to display in the tooltip; can contain markup
*/
-void meta_fixed_tip_show (int screen_number,
- int root_x, int root_y,
+void meta_fixed_tip_show (int root_x, int root_y,
const char *markup_text);
/**
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 2703f448..2cee5192 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -550,12 +550,11 @@ meta_frames_calc_geometry (MetaFrames *frames,
}
MetaFrames*
-meta_frames_new (int screen_number)
+meta_frames_new (void)
{
GdkScreen *screen;
- screen = gdk_display_get_screen (gdk_display_get_default (),
- screen_number);
+ screen = gdk_display_get_default_screen (gdk_display_get_default ());
return g_object_new (META_TYPE_FRAMES,
"screen", screen,
@@ -1155,7 +1154,6 @@ show_tip_now (MetaFrames *frames)
MetaFrameGeometry fgeom;
GdkRectangle *rect;
int dx, dy;
- int screen_number;
meta_frames_calc_geometry (frames, frame, &fgeom);
@@ -1169,10 +1167,7 @@ show_tip_now (MetaFrames *frames)
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
dx += rect->width;
- screen_number = gdk_x11_screen_get_screen_number (gtk_widget_get_screen (GTK_WIDGET (frames)));
-
- meta_fixed_tip_show (screen_number,
- rect->x + dx,
+ meta_fixed_tip_show (rect->x + dx,
rect->y + rect->height + 2 + dy,
tiptext);
}
diff --git a/src/ui/frames.h b/src/ui/frames.h
index a5d50011..0c7f3a5c 100644
--- a/src/ui/frames.h
+++ b/src/ui/frames.h
@@ -112,7 +112,7 @@ struct _MetaFramesClass
GType meta_frames_get_type (void) G_GNUC_CONST;
-MetaFrames *meta_frames_new (int screen_number);
+MetaFrames *meta_frames_new (void);
void meta_frames_manage_window (MetaFrames *frames,
Window xwindow,
diff --git a/src/ui/resizepopup.c b/src/ui/resizepopup.c
index a4d9e976..c60fcd65 100644
--- a/src/ui/resizepopup.c
+++ b/src/ui/resizepopup.c
@@ -78,8 +78,7 @@ ensure_size_window (MetaResizePopup *popup)
popup->size_window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_screen (GTK_WINDOW (popup->size_window),
- gdk_display_get_screen (gdk_x11_lookup_xdisplay (popup->display),
- popup->screen_number));
+ gdk_display_get_default_screen (gdk_x11_lookup_xdisplay (popup->display)));
/* never shrink the size window */
gtk_window_set_resizable (GTK_WINDOW (popup->size_window),
diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c
index 8bbf91ef..a9e6d35e 100644
--- a/src/ui/tabpopup.c
+++ b/src/ui/tabpopup.c
@@ -214,7 +214,6 @@ tab_entry_new (const MetaTabEntry *entry,
MetaTabPopup*
meta_ui_tab_popup_new (const MetaTabEntry *entries,
- int screen_number,
int entry_count,
int width,
gint border)
@@ -235,8 +234,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
popup->outline_window = gtk_window_new (GTK_WINDOW_POPUP);
- screen = gdk_display_get_screen (gdk_display_get_default (),
- screen_number);
+ screen = gdk_display_get_default_screen (gdk_display_get_default ());
gtk_window_set_screen (GTK_WINDOW (popup->outline_window),
screen);
diff --git a/src/ui/tile-preview.c b/src/ui/tile-preview.c
index 88962467..d99529ff 100644
--- a/src/ui/tile-preview.c
+++ b/src/ui/tile-preview.c
@@ -124,12 +124,12 @@ on_preview_window_style_set (GtkWidget *widget,
}
MetaTilePreview *
-meta_tile_preview_new (int screen_number)
+meta_tile_preview_new (void)
{
MetaTilePreview *preview;
GdkScreen *screen;
- screen = gdk_display_get_screen (gdk_display_get_default (), screen_number);
+ screen = gdk_display_get_default_screen (gdk_display_get_default ());
preview = g_new (MetaTilePreview, 1);
diff --git a/src/ui/ui.c b/src/ui/ui.c
index 2c1747ff..767f72b3 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -279,7 +279,7 @@ meta_ui_new (Display *xdisplay,
g_assert (gdisplay == gdk_display_get_default ());
g_assert (xdisplay == GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
- ui->frames = meta_frames_new (XScreenNumberOfScreen (screen));
+ ui->frames = meta_frames_new ();
/* This does not actually show any widget. MetaFrames has been hacked so
* that showing it doesn't actually do anything. But we need the flags
* set for GTK to deliver events properly. */
@@ -321,11 +321,10 @@ meta_ui_create_frame_window (MetaUI *ui,
gint x,
gint y,
gint width,
- gint height,
- gint screen_no)
+ gint height)
{
GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay);
- GdkScreen *screen = gdk_display_get_screen (display, screen_no);
+ GdkScreen *screen = gdk_display_get_default_screen (display);
GdkWindowAttr attrs;
gint attributes_mask;
GdkWindow *window;
@@ -686,7 +685,7 @@ meta_ui_theme_get_frame_borders (MetaUI *ui,
if (!font_desc)
{
GdkDisplay *display = gdk_x11_lookup_xdisplay (ui->xdisplay);
- GdkScreen *screen = gdk_display_get_screen (display, XScreenNumberOfScreen (ui->xscreen));
+ GdkScreen *screen = gdk_display_get_default_screen (display);
GtkWidgetPath *widget_path;
style = gtk_style_context_new ();