After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 81651 - Tooltips is not multihead safe.
Tooltips is not multihead safe.
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.0.x
Other Solaris
: Normal critical
: ---
Assigned To: Erwann Chenede
Erwann Chenede
: 90191 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-05-13 15:32 UTC by Erwann Chenede
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch as applied (3.23 KB, patch)
2002-10-22 21:03 UTC, Owen Taylor
none Details | Review

Description Erwann Chenede 2002-05-13 15:32:33 UTC
mozilla with gtk+ 2.1 coredump on startup

See http://bugzilla.mozilla.org/show_bug.cgi?id=140698 for 
details.

Here is a small patch to fix the problem :

Index: gtk/gtktooltips.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktooltips.c,v
retrieving revision 1.50
diff -u -r1.50 gtktooltips.c
--- gtk/gtktooltips.c	29 Apr 2002 22:53:39 -0000	1.50
+++ gtk/gtktooltips.c	13 May 2002 15:26:59 -0000
@@ -174,8 +174,9 @@
   if (!tooltips->tip_window)
     {
       tooltips->tip_window = gtk_window_new (GTK_WINDOW_POPUP);
-      gtk_window_set_screen (GTK_WINDOW (tooltips->tip_window),
-			     gtk_widget_get_screen (tooltips->active_tips_data->widget));
+      if (tooltips->active_tips_data)
+	gtk_window_set_screen (GTK_WINDOW (tooltips->tip_window),
+			       gtk_widget_get_screen (tooltips->active_tips_data->widget));
       gtk_widget_set_app_paintable (tooltips->tip_window, TRUE);
       gtk_window_set_policy (GTK_WINDOW (tooltips->tip_window), FALSE,
FALSE, TRUE);
       gtk_widget_set_name (tooltips->tip_window, "gtk-tooltips");


Can I commit ?
Comment 1 Owen Taylor 2002-05-13 16:21:43 UTC
One of the notes I have from my merge and that I haven't had
a chance to writeup/ put into bugzilla yet is that GtkTooltips
is not multihead safe.

Every time the current widget changes, the code needs to move
the tips window to the screen for that widget if necessary.
(The code can't assume that all widgets for a single GtkTooltips
object will be on the same screen.)

The patch above can't be correct ... since it will just leave
the tooltips window on the default screen.
Comment 2 Erwann Chenede 2002-05-14 17:19:10 UTC
To implement this properly, adding a SCREEN signal to gtk window
would the right way to go.

Am I correct ?
Comment 3 Owen Taylor 2002-05-14 19:31:52 UTC
No separate signal is needed since you can connect to
notify::screen.

But if tooltips pop down when the widget is unrealized / hidden
(I think they will) I'm not sure watching the screen is 
necessary.
Comment 4 Erwann Chenede 2002-05-15 14:32:17 UTC
Once again, you are right :)

Here is a simple patch which insure the tooltip window is displayed 
on the correct screen when the tip is drawn :


Index: gtk/gtktooltips.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktooltips.c,v
retrieving revision 1.50
diff -u -r1.50 gtktooltips.c
--- gtk/gtktooltips.c	29 Apr 2002 22:53:39 -0000	1.50
+++ gtk/gtktooltips.c	15 May 2002 14:25:28 -0000
@@ -340,6 +340,10 @@
   keyboard_mode = get_keyboard_mode (widget);
   
   screen = gtk_widget_get_screen (widget);
+
+  if (gtk_window_get_screen (GTK_WINDOW (tooltips->tip_window)) !=
screen)
+    gtk_window_set_screen (GTK_WINDOW (tooltips->tip_window),
screen);
+  
   scr_w = gdk_screen_get_width (screen);
   scr_h = gdk_screen_get_height (screen);



can I commit ?
Comment 5 Jay Yan 2002-06-17 07:52:41 UTC
Hi, all, what is the status of this bug?
Comment 6 Owen Taylor 2002-09-26 22:42:42 UTC
*** Bug 90191 has been marked as a duplicate of this bug. ***
Comment 7 Erwann Chenede 2002-10-07 17:07:55 UTC
I believe the patch from Bug 90191 solve the source of the problem 
(I forgot the set the screen in some cases).

Owen: Can I commit ?
Comment 8 Owen Taylor 2002-10-22 21:03:07 UTC
Created attachment 11765 [details] [review]
Patch as applied
Comment 9 Owen Taylor 2002-10-22 21:04:24 UTC
I ended up with something a fair bit more complex, because
I needed to handle the case where the display for the
current tooltips->tip_window was closed ... in that case,
it is necessary to destroy the tip_widow to avoid leaving
a window open on the closed display.

Tue Oct 22 16:37:12 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtktooltips.c: Multihead safety fixes, handle
        displays being closed. (#81651, based on patch
        from Erwann Chenede)