Commit 659d46c2 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

always position the menu inside the screen boundaries.

2000-09-14  Michael Natterer  <mitch@gimp.org>

	* app/disp_callbacks.c: always position the menu inside the
	screen boundaries.
parent 9d4e8b7d
2000-09-14 Michael Natterer <mitch@gimp.org>
* app/disp_callbacks.c: always position the menu inside the
screen boundaries.
2000-09-14 Michael Natterer <mitch@gimp.org>
 
* app/disp_callbacks.c: new function gdisplay_origin_menu_position()
......
......@@ -686,8 +686,14 @@ gdisplay_origin_menu_position (GtkMenu *menu,
gdk_window_get_origin (origin->window, &origin_x, &origin_y);
*x = origin_x + origin->allocation.x + origin->allocation.width;
*y = origin_y + origin->allocation.y + origin->allocation.height / 2;
*x = origin_x + origin->allocation.x + origin->allocation.width - 1;
*y = origin_y + origin->allocation.y + (origin->allocation.height - 1) / 2;
if (*x + GTK_WIDGET (menu)->allocation.width > gdk_screen_width ())
*x -= (GTK_WIDGET (menu)->allocation.width + origin->allocation.width);
if (*y + GTK_WIDGET (menu)->allocation.height > gdk_screen_height ())
*y -= (GTK_WIDGET (menu)->allocation.height);
}
gint
......
......@@ -686,8 +686,14 @@ gdisplay_origin_menu_position (GtkMenu *menu,
gdk_window_get_origin (origin->window, &origin_x, &origin_y);
*x = origin_x + origin->allocation.x + origin->allocation.width;
*y = origin_y + origin->allocation.y + origin->allocation.height / 2;
*x = origin_x + origin->allocation.x + origin->allocation.width - 1;
*y = origin_y + origin->allocation.y + (origin->allocation.height - 1) / 2;
if (*x + GTK_WIDGET (menu)->allocation.width > gdk_screen_width ())
*x -= (GTK_WIDGET (menu)->allocation.width + origin->allocation.width);
if (*y + GTK_WIDGET (menu)->allocation.height > gdk_screen_height ())
*y -= (GTK_WIDGET (menu)->allocation.height);
}
gint
......
......@@ -686,8 +686,14 @@ gdisplay_origin_menu_position (GtkMenu *menu,
gdk_window_get_origin (origin->window, &origin_x, &origin_y);
*x = origin_x + origin->allocation.x + origin->allocation.width;
*y = origin_y + origin->allocation.y + origin->allocation.height / 2;
*x = origin_x + origin->allocation.x + origin->allocation.width - 1;
*y = origin_y + origin->allocation.y + (origin->allocation.height - 1) / 2;
if (*x + GTK_WIDGET (menu)->allocation.width > gdk_screen_width ())
*x -= (GTK_WIDGET (menu)->allocation.width + origin->allocation.width);
if (*y + GTK_WIDGET (menu)->allocation.height > gdk_screen_height ())
*y -= (GTK_WIDGET (menu)->allocation.height);
}
gint
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment