Make menus work better on Xinerama (#126150):

Tue Jan 27 01:46:54 2004  Matthias Clasen  <maclas@gmx.de>

	Make menus work better on Xinerama (#126150):

	* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Calculate the
	monitor_num on the screen of the menu, not of the attach widget.

	* gtk/gtkmenu.c (menu_change_screen): Forget the stored monitor_num.
	(gtk_menu_window_size_request): Remember the monitor_num.
This commit is contained in:
Matthias Clasen 2004-01-27 00:49:03 +00:00 committed by Matthias Clasen
parent ae395158da
commit 519a586ac4
7 changed files with 55 additions and 5 deletions

View File

@ -1,3 +1,13 @@
Tue Jan 27 01:46:54 2004 Matthias Clasen <maclas@gmx.de>
Make menus work better on Xinerama (#126150):
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Calculate the
monitor_num on the screen of the menu, not of the attach widget.
* gtk/gtkmenu.c (menu_change_screen): Forget the stored monitor_num.
(gtk_menu_window_size_request): Remember the monitor_num.
2004-01-26 Federico Mena Quintero <federico@ximian.com>
Fix #105497; constify uses of GdkColor.

View File

@ -1,3 +1,13 @@
Tue Jan 27 01:46:54 2004 Matthias Clasen <maclas@gmx.de>
Make menus work better on Xinerama (#126150):
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Calculate the
monitor_num on the screen of the menu, not of the attach widget.
* gtk/gtkmenu.c (menu_change_screen): Forget the stored monitor_num.
(gtk_menu_window_size_request): Remember the monitor_num.
2004-01-26 Federico Mena Quintero <federico@ximian.com>
Fix #105497; constify uses of GdkColor.

View File

@ -1,3 +1,13 @@
Tue Jan 27 01:46:54 2004 Matthias Clasen <maclas@gmx.de>
Make menus work better on Xinerama (#126150):
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Calculate the
monitor_num on the screen of the menu, not of the attach widget.
* gtk/gtkmenu.c (menu_change_screen): Forget the stored monitor_num.
(gtk_menu_window_size_request): Remember the monitor_num.
2004-01-26 Federico Mena Quintero <federico@ximian.com>
Fix #105497; constify uses of GdkColor.

View File

@ -1,3 +1,13 @@
Tue Jan 27 01:46:54 2004 Matthias Clasen <maclas@gmx.de>
Make menus work better on Xinerama (#126150):
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Calculate the
monitor_num on the screen of the menu, not of the attach widget.
* gtk/gtkmenu.c (menu_change_screen): Forget the stored monitor_num.
(gtk_menu_window_size_request): Remember the monitor_num.
2004-01-26 Federico Mena Quintero <federico@ximian.com>
Fix #105497; constify uses of GdkColor.

View File

@ -1,3 +1,13 @@
Tue Jan 27 01:46:54 2004 Matthias Clasen <maclas@gmx.de>
Make menus work better on Xinerama (#126150):
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Calculate the
monitor_num on the screen of the menu, not of the attach widget.
* gtk/gtkmenu.c (menu_change_screen): Forget the stored monitor_num.
(gtk_menu_window_size_request): Remember the monitor_num.
2004-01-26 Federico Mena Quintero <federico@ximian.com>
Fix #105497; constify uses of GdkColor.

View File

@ -696,11 +696,8 @@ gtk_menu_window_size_request (GtkWidget *window,
{
GdkScreen *screen = gtk_widget_get_screen (window);
GdkRectangle monitor;
gint monitor_num;
monitor_num = gdk_screen_get_monitor_at_point (screen,
private->x, private->y);
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
gdk_screen_get_monitor_geometry (screen, private->monitor_num, &monitor);
if (private->y + requisition->height > monitor.y + monitor.height)
requisition->height = monitor.y + monitor.height - private->y;
@ -819,6 +816,8 @@ static void
menu_change_screen (GtkMenu *menu,
GdkScreen *new_screen)
{
GtkMenuPrivate *private = gtk_menu_get_private (menu);
if (menu->torn_off)
{
gtk_window_set_screen (GTK_WINDOW (menu->tearoff_window), new_screen);
@ -826,6 +825,7 @@ menu_change_screen (GtkMenu *menu,
}
gtk_window_set_screen (GTK_WINDOW (menu->toplevel), new_screen);
private->monitor_num = -1;
}
static void

View File

@ -1048,7 +1048,7 @@ gtk_menu_item_position_menu (GtkMenu *menu,
twidth = GTK_WIDGET (menu)->requisition.width;
theight = GTK_WIDGET (menu)->requisition.height;
screen = gtk_widget_get_screen (widget);
screen = gtk_widget_get_screen (GTK_WIDGET (menu));
monitor_num = gdk_screen_get_monitor_at_window (screen, menu_item->event_window);
if (monitor_num < 0)
monitor_num = 0;