mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
keep the tooltip on the screen horizontally, #76825
2002-05-11 Havoc Pennington <hp@pobox.com> * src/fixedtip.c (meta_fixed_tip_show): keep the tooltip on the screen horizontally, #76825 * src/window.c (meta_window_handle_mouse_grab_op_event): end grab op _after_ doing the final update of the move or resize. Hopefully I didn't have a reason for the order I was using before.
This commit is contained in:
parent
9598affa03
commit
a3460b8ac8
@ -1,3 +1,12 @@
|
||||
2002-05-11 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/fixedtip.c (meta_fixed_tip_show): keep the tooltip
|
||||
on the screen horizontally, #76825
|
||||
|
||||
* src/window.c (meta_window_handle_mouse_grab_op_event): end grab
|
||||
op _after_ doing the final update of the move or resize.
|
||||
Hopefully I didn't have a reason for the order I was using before.
|
||||
|
||||
2002-05-10 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/tools/metacity-window-demo.c: add override redirect test
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
static GtkWidget *tip = NULL;
|
||||
static GtkWidget *label = NULL;
|
||||
static int screen_width = 0;
|
||||
static int screen_height = 0;
|
||||
|
||||
static gint
|
||||
expose_handler (GtkTooltips *tooltips)
|
||||
@ -40,14 +42,27 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number,
|
||||
int root_x, int root_y,
|
||||
const char *markup_text)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
if (tip == NULL)
|
||||
{
|
||||
tip = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
#ifdef HAVE_GTK_MULTIHEAD
|
||||
{
|
||||
GdkScreen *gdk_screen;
|
||||
|
||||
gdk_screen = gdk_display_get_screen (gdk_get_default_display (),
|
||||
screen_number);
|
||||
gtk_window_set_screen (GTK_WINDOW (tip),
|
||||
gdk_display_get_screen (gdk_get_default_display (),
|
||||
screen_number));
|
||||
gdk_screen);
|
||||
screen_width = gdk_screen_get_width (gdk_screen);
|
||||
screen_height = gdk_screen_get_height (gdk_screen);
|
||||
}
|
||||
#else
|
||||
screen_width = gdk_screen_width ();
|
||||
screen_height = gdk_screen_height ();
|
||||
#endif
|
||||
|
||||
gtk_widget_set_app_paintable (tip, TRUE);
|
||||
gtk_window_set_policy (GTK_WINDOW (tip), FALSE, FALSE, TRUE);
|
||||
gtk_widget_set_name (tip, "gtk-tooltips");
|
||||
@ -71,9 +86,17 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number,
|
||||
&tip);
|
||||
}
|
||||
|
||||
gtk_widget_set_uposition (tip, root_x, root_y);
|
||||
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);
|
||||
if ((root_x + w) > screen_width)
|
||||
root_x -= (root_x + w) - screen_width;
|
||||
|
||||
gtk_window_move (GTK_WINDOW (tip), root_x, root_y);
|
||||
|
||||
gtk_widget_show (tip);
|
||||
}
|
||||
|
||||
|
@ -376,6 +376,13 @@ raise_window_relative_to_managed_windows (MetaScreen *screen,
|
||||
{
|
||||
/* This function is used to avoid raising a window above popup
|
||||
* menus and other such things.
|
||||
*
|
||||
* FIXME This is sort of an expensive function, should probably
|
||||
* do something to avoid it. One approach would be to reverse
|
||||
* the stacking algorithm to work by placing each window above
|
||||
* the others, and start by lowering a window to the bottom
|
||||
* (instead of the current way, which works by placing each
|
||||
* window below another and starting with a raise)
|
||||
*/
|
||||
|
||||
Window ignored1, ignored2;
|
||||
|
@ -5474,8 +5474,6 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
|
||||
switch (event->type)
|
||||
{
|
||||
case ButtonRelease:
|
||||
meta_display_end_grab_op (window->display, event->xbutton.time);
|
||||
|
||||
switch (window->display->grab_op)
|
||||
{
|
||||
case META_GRAB_OP_MOVING:
|
||||
@ -5497,6 +5495,8 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
meta_display_end_grab_op (window->display, event->xbutton.time);
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
|
Loading…
Reference in New Issue
Block a user