[metacity] fixedtip: use default screen
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] fixedtip: use default screen
- Date: Sat, 11 Jun 2016 22:56:10 +0000 (UTC)
commit 82c5a4d929a55d7782b18989a28bf5d1d49dae15
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Jun 12 00:48:33 2016 +0300
fixedtip: use default screen
src/ui/fixedtip.c | 12 ++++--------
src/ui/fixedtip.h | 5 +----
src/ui/frames.c | 6 +-----
3 files changed, 6 insertions(+), 17 deletions(-)
---
diff --git a/src/ui/fixedtip.c b/src/ui/fixedtip.c
index 2c6c58a..a1bb410 100644
--- a/src/ui/fixedtip.c
+++ b/src/ui/fixedtip.c
@@ -34,11 +34,6 @@ static GtkWidget *tip = NULL;
*/
static GtkWidget *label = NULL;
-/**
- *
- */
-static GdkScreen *screen = NULL;
-
static gboolean
draw_handler (GtkWidget *widget,
cairo_t *cr)
@@ -61,16 +56,18 @@ 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)
{
+ GdkScreen *screen;
gint w;
gint h;
gint mon_num;
GdkRectangle monitor;
gint screen_right_edge;
+ screen = gdk_screen_get_default ();
+
if (tip == NULL)
{
GdkVisual *visual;
@@ -81,7 +78,6 @@ 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);
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 039387f..bc4207e 100644
--- a/src/ui/fixedtip.h
+++ b/src/ui/fixedtip.h
@@ -47,13 +47,11 @@
* displayed, but if it is the window will be reused rather than destroyed
* and recreated.
*
- * \param screen_number The number of the screen.
* \param root_x The X coordinate where the tooltip should appear
* \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);
/**
@@ -62,5 +60,4 @@ void meta_fixed_tip_show (int screen_number,
*/
void meta_fixed_tip_hide (void);
-
#endif
diff --git a/src/ui/frames.c b/src/ui/frames.c
index af9fff0..7b55735 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -1131,7 +1131,6 @@ show_tip_now (MetaFrames *frames)
MetaFrameGeometry fgeom;
GdkRectangle *rect;
int dx, dy;
- int screen_number;
meta_frames_calc_geometry (frames, frame, &fgeom);
@@ -1145,10 +1144,7 @@ show_tip_now (MetaFrames *frames)
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
dx += rect->width;
- screen_number = gdk_screen_get_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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]