If the screen for the menu changes while the menu is torn off, move the

Fri Dec 13 22:55:27 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c (menu_change_screen): If the screen
        for the menu changes while the menu is torn off, move
        the tearoff along with it. (#85669)

        * gtk/gtkmenu.c (gtk_menu_set_tearoff_state): When
        reattaching, get rid of the get rid of the tearoff window.
This commit is contained in:
Owen Taylor 2002-12-14 04:07:08 +00:00 committed by Owen Taylor
parent 30b328e79a
commit 4f14fc15e6
7 changed files with 75 additions and 3 deletions

View File

@ -1,3 +1,12 @@
Fri Dec 13 22:55:27 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (menu_change_screen): If the screen
for the menu changes while the menu is torn off, move
the tearoff along with it. (#85669)
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state): When
reattaching, get rid of the get rid of the tearoff window.
Fri Dec 13 21:35:12 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_motion): Handle

View File

@ -1,3 +1,12 @@
Fri Dec 13 22:55:27 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (menu_change_screen): If the screen
for the menu changes while the menu is torn off, move
the tearoff along with it. (#85669)
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state): When
reattaching, get rid of the get rid of the tearoff window.
Fri Dec 13 21:35:12 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_motion): Handle

View File

@ -1,3 +1,12 @@
Fri Dec 13 22:55:27 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (menu_change_screen): If the screen
for the menu changes while the menu is torn off, move
the tearoff along with it. (#85669)
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state): When
reattaching, get rid of the get rid of the tearoff window.
Fri Dec 13 21:35:12 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_motion): Handle

View File

@ -1,3 +1,12 @@
Fri Dec 13 22:55:27 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (menu_change_screen): If the screen
for the menu changes while the menu is torn off, move
the tearoff along with it. (#85669)
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state): When
reattaching, get rid of the get rid of the tearoff window.
Fri Dec 13 21:35:12 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_motion): Handle

View File

@ -1,3 +1,12 @@
Fri Dec 13 22:55:27 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (menu_change_screen): If the screen
for the menu changes while the menu is torn off, move
the tearoff along with it. (#85669)
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state): When
reattaching, get rid of the get rid of the tearoff window.
Fri Dec 13 21:35:12 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_motion): Handle

View File

@ -1,3 +1,12 @@
Fri Dec 13 22:55:27 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (menu_change_screen): If the screen
for the menu changes while the menu is torn off, move
the tearoff along with it. (#85669)
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state): When
reattaching, get rid of the get rid of the tearoff window.
Fri Dec 13 21:35:12 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_motion): Handle

View File

@ -530,6 +530,19 @@ gtk_menu_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
menu_change_screen (GtkMenu *menu,
GdkScreen *new_screen)
{
if (menu->torn_off)
{
gtk_window_set_screen (GTK_WINDOW (menu->tearoff_window), new_screen);
gtk_menu_position (menu);
}
gtk_window_set_screen (GTK_WINDOW (menu->toplevel), new_screen);
}
static void
attach_widget_screen_changed (GtkWidget *attach_widget,
GdkScreen *previous_screen,
@ -538,8 +551,7 @@ attach_widget_screen_changed (GtkWidget *attach_widget,
if (gtk_widget_has_screen (attach_widget) &&
!g_object_get_data (G_OBJECT (menu), "gtk-menu-explicit-screen"))
{
gtk_window_set_screen (GTK_WINDOW (menu->toplevel),
gtk_widget_get_screen (attach_widget));
menu_change_screen (menu, gtk_widget_get_screen (attach_widget));
}
}
@ -1307,6 +1319,12 @@ gtk_menu_set_tearoff_state (GtkMenu *menu,
{
gtk_widget_hide (menu->tearoff_window);
gtk_menu_reparent (menu, menu->toplevel, FALSE);
gtk_widget_destroy (menu->tearoff_window);
menu->tearoff_window = NULL;
menu->tearoff_hbox = NULL;
menu->tearoff_scrollbar = NULL;
menu->tearoff_adjustment = NULL;
}
}
}
@ -2972,7 +2990,7 @@ gtk_menu_set_screen (GtkMenu *menu,
if (screen)
{
gtk_window_set_screen (GTK_WINDOW (menu->toplevel), screen);
menu_change_screen (menu, screen);
}
else
{