Commit 519a586a authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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.
parent ae395158
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.
......
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.
......
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.
......
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.
......
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.
......
......@@ -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
......
......@@ -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;
......
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