]> Pileus Git - ~andy/gtk/commitdiff
If the screen for the menu changes while the menu is torn off, move the
authorOwen Taylor <otaylor@redhat.com>
Sat, 14 Dec 2002 04:07:08 +0000 (04:07 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Sat, 14 Dec 2002 04:07:08 +0000 (04:07 +0000)
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.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkmenu.c

index 3ddadb63a5346c0f84a2fa53a98df0f33d670838..6fc79c3bda53647dea3d1dba643bbad3efcf78d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 3ddadb63a5346c0f84a2fa53a98df0f33d670838..6fc79c3bda53647dea3d1dba643bbad3efcf78d3 100644 (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
index 3ddadb63a5346c0f84a2fa53a98df0f33d670838..6fc79c3bda53647dea3d1dba643bbad3efcf78d3 100644 (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
index 3ddadb63a5346c0f84a2fa53a98df0f33d670838..6fc79c3bda53647dea3d1dba643bbad3efcf78d3 100644 (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
index 3ddadb63a5346c0f84a2fa53a98df0f33d670838..6fc79c3bda53647dea3d1dba643bbad3efcf78d3 100644 (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
index 3ddadb63a5346c0f84a2fa53a98df0f33d670838..6fc79c3bda53647dea3d1dba643bbad3efcf78d3 100644 (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
index ee2f8a0e15341b8d4bf5cd602aa1b4f44f2af29a..3e93a8e5cf223f5e983a72cd3da2d6998b6c3caf 100644 (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
     {