mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
Patch from John Paul Wallington to keep tooltip on screen horizontally for
2005-01-26 Elijah Newren <newren@gmail.com> Patch from John Paul Wallington to keep tooltip on screen horizontally for xinerama. Fixes #165261. * src/fixedtip.c: (meta_fixed_tip_show): rename screen_width and screen_height to screen_right_edge and screen_bottom_edge, set them using xinerama info instead of just screen geometry, and use them to determine where to place the tooltip window.
This commit is contained in:
parent
cf102c12f4
commit
893309b372
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2005-01-26 Elijah Newren <newren@gmail.com>
|
||||||
|
|
||||||
|
Patch from John Paul Wallington to keep tooltip on screen
|
||||||
|
horizontally for xinerama. Fixes #165261.
|
||||||
|
|
||||||
|
* src/fixedtip.c: (meta_fixed_tip_show): rename screen_width and
|
||||||
|
screen_height to screen_right_edge and screen_bottom_edge, set
|
||||||
|
them using xinerama info instead of just screen geometry, and use
|
||||||
|
them to determine where to place the tooltip window.
|
||||||
|
|
||||||
2005-01-26 Arvind Samptur <arvind.samptur@wipro.com>
|
2005-01-26 Arvind Samptur <arvind.samptur@wipro.com>
|
||||||
|
|
||||||
Don't wireframe when accessibility is on, it apparently
|
Don't wireframe when accessibility is on, it apparently
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
|
|
||||||
static GtkWidget *tip = NULL;
|
static GtkWidget *tip = NULL;
|
||||||
static GtkWidget *label = NULL;
|
static GtkWidget *label = NULL;
|
||||||
static int screen_width = 0;
|
static int screen_right_edge = 0;
|
||||||
static int screen_height = 0;
|
static int screen_bottom_edge = 0;
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
expose_handler (GtkTooltips *tooltips)
|
expose_handler (GtkTooltips *tooltips)
|
||||||
@ -50,13 +50,17 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number,
|
|||||||
tip = gtk_window_new (GTK_WINDOW_POPUP);
|
tip = gtk_window_new (GTK_WINDOW_POPUP);
|
||||||
{
|
{
|
||||||
GdkScreen *gdk_screen;
|
GdkScreen *gdk_screen;
|
||||||
|
GdkRectangle monitor;
|
||||||
|
gint mon_num;
|
||||||
|
|
||||||
gdk_screen = gdk_display_get_screen (gdk_display_get_default (),
|
gdk_screen = gdk_display_get_screen (gdk_display_get_default (),
|
||||||
screen_number);
|
screen_number);
|
||||||
gtk_window_set_screen (GTK_WINDOW (tip),
|
gtk_window_set_screen (GTK_WINDOW (tip),
|
||||||
gdk_screen);
|
gdk_screen);
|
||||||
screen_width = gdk_screen_get_width (gdk_screen);
|
mon_num = gdk_screen_get_monitor_at_point (gdk_screen, root_x, root_y);
|
||||||
screen_height = gdk_screen_get_height (gdk_screen);
|
gdk_screen_get_monitor_geometry (gdk_screen, mon_num, &monitor);
|
||||||
|
screen_right_edge = monitor.x + monitor.width;
|
||||||
|
screen_bottom_edge = monitor.y + monitor.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_set_app_paintable (tip, TRUE);
|
gtk_widget_set_app_paintable (tip, TRUE);
|
||||||
@ -80,12 +84,9 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number,
|
|||||||
|
|
||||||
gtk_label_set_markup (GTK_LABEL (label), markup_text);
|
gtk_label_set_markup (GTK_LABEL (label), markup_text);
|
||||||
|
|
||||||
/* FIXME should also handle Xinerama here, just to be
|
|
||||||
* really cool
|
|
||||||
*/
|
|
||||||
gtk_window_get_size (GTK_WINDOW (tip), &w, &h);
|
gtk_window_get_size (GTK_WINDOW (tip), &w, &h);
|
||||||
if ((root_x + w) > screen_width)
|
if ((root_x + w) > screen_right_edge)
|
||||||
root_x -= (root_x + w) - screen_width;
|
root_x -= (root_x + w) - screen_right_edge;
|
||||||
|
|
||||||
gtk_window_move (GTK_WINDOW (tip), root_x, root_y);
|
gtk_window_move (GTK_WINDOW (tip), root_x, root_y);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user