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:
Havoc Pennington 2002-05-11 05:09:54 +00:00 committed by Havoc Pennington
parent 9598affa03
commit a3460b8ac8
4 changed files with 49 additions and 10 deletions

View File

@ -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

View File

@ -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
gtk_window_set_screen (GTK_WINDOW (tip),
gdk_display_get_screen (gdk_get_default_display (),
screen_number));
{
GdkScreen *gdk_screen;
gdk_screen = gdk_display_get_screen (gdk_get_default_display (),
screen_number);
gtk_window_set_screen (GTK_WINDOW (tip),
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");
@ -70,9 +85,17 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number,
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
&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);
}

View File

@ -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;

View File

@ -5473,9 +5473,7 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
{
switch (event->type)
{
case ButtonRelease:
meta_display_end_grab_op (window->display, event->xbutton.time);
case ButtonRelease:
switch (window->display->grab_op)
{
case META_GRAB_OP_MOVING:
@ -5496,7 +5494,9 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
default:
break;
}
}
meta_display_end_grab_op (window->display, event->xbutton.time);
break;
case MotionNotify: