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 144490 - Incorrect position of volume dialog
Incorrect position of volume dialog
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: [obsolete] settings-daemon
unspecified
Other Linux
: High normal
: ---
Assigned To: Devin Carraway
Devin Carraway
: 152923 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-06-16 19:51 UTC by Pierre Ossman
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8


Attachments
Delayed position (643 bytes, patch)
2004-06-16 19:53 UTC, Pierre Ossman
none Details | Review
Fix the initial position of the dialog window (759 bytes, patch)
2004-09-12 09:04 UTC, Michal Bukovjan
none Details | Review

Description Pierre Ossman 2004-06-16 19:51:50 UTC
1. Change volume or mute
2. Dialog shows up in top left corner (0x0)
3. Change volume again (before the windows dissappears)
4. Dialog shows up where it should
Comment 1 Pierre Ossman 2004-06-16 19:53:10 UTC
Created attachment 28779 [details] [review]
Delayed position

If the move of the window is delayed until after the window is shown it works.
I don't know enough GTK to speculate why that is but this patch at least solves
the problem.
Comment 2 Olav Vitters 2004-08-28 19:11:26 UTC
I see this too in 2.7.x (jhbuild) and 2.6.x. Updating version.

Bug has patch, changing prio to High.
Comment 3 Carlos Garnacho 2004-08-30 11:45:33 UTC
2.7 code freeze is arriving for control center too, what's happenning with this?
I think it's a quite annoying and visible bug
Comment 4 Jonathan Blandford 2004-08-30 12:58:27 UTC
Fix is fine, and obviously non-destructive.  Please write a changelog entry and
commit.
Comment 5 Carlos Garnacho 2004-08-30 13:07:21 UTC
Commited, thanks :)
Comment 6 Pierre Ossman 2004-08-30 16:13:00 UTC
The patch is a rather dirty fix. Perhaps a new bug should be opened that finds
the real cause of this problem?
With the current patch one can still see the window appear briefly in the top
left corner.
Comment 7 Michal Bukovjan 2004-09-12 09:03:44 UTC
I think I have a correct solution in hand (at least as I checked with GTK API docs).
Comment 8 Michal Bukovjan 2004-09-12 09:04:58 UTC
Created attachment 31504 [details] [review]
Fix the initial position of the dialog window

This patch is against 2.6.1.
Comment 9 Frederic Crozat 2004-09-14 15:36:39 UTC
Comment on attachment 31504 [details] [review]
Fix the initial position of the dialog window

>--- control-center-2.6.1/gnome-settings-daemon/gnome-settings-multimedia-keys.c.location	2004-09-11 11:08:29.000000000 +0200
>+++ control-center-2.6.1/gnome-settings-daemon/gnome-settings-multimedia-keys.c	2004-09-11 11:59:10.006083352 +0200
>@@ -539,13 +539,9 @@
> 	x = ((screen_w - orig_w) / 2) + geometry.x;
> 	y = geometry.y + (screen_h / 2) + (screen_h / 2 - orig_h) / 2;
> 
>-	gdk_window_move (GTK_WIDGET (acme->dialog)->window, x, y);
>+	gtk_window_move (acme->dialog, x, y);

You are missing a GTK_WINDOW around acme->dialog otherwise you get a warning at
compile time. But it is in fact
the real fix for the bug (it wasn't moving gdk_window_move after
gtk_widget_show but use gtk_window_move instead, and call it *before*
gtk_widget_show.

> 
>-	gtk_widget_show (acme->dialog);
>-
>-	/* this makes sure the dialog is actually shown */
>-	while (gtk_events_pending())
>-		gtk_main_iteration();
>+	gtk_widget_show_now (acme->dialog);

Not needed, and the code is exactly the same (look at _show_now code)

So, real fix is 

gtk_window_move (GTK_WINDOW (acme->dialog), x, y);

gtk_widget_show (acme->dialog);

and keep the while loop.
> 
> 	acme->dialog_timeout = gtk_timeout_add (DIALOG_TIMEOUT,
> 			(GtkFunction) dialog_hide, acme);
Comment 10 Bastien Nocera 2004-09-29 20:29:17 UTC
Cheers guys, I wasn't even CC: on that bug...

What I can tell you is that the original piece of code used to work on acme
stand-alone, and in all the version that I saw afterwards. But it seems that it
might have been broken with a recent gtk+.

Comment 11 Bastien Nocera 2004-09-29 20:53:36 UTC
2004-09-29  Bastien Nocera  <hadess@hadess.net>
                                                                            
        * gnome-settings-multimedia-keys.c: (dialog_show): rework the
        dialog_show so that the dialog is moved before it's shown, and
        use gdk_display_sync() instead of a event looping to avoid
        "reentrancy" problems when showing/hiding the dialog in fast
        successions (Closes: #144490)

Re-open if you have any problems with the current CVS code, thanks.
Comment 12 Michal Bukovjan 2004-10-03 06:02:42 UTC
Would not a calling of gtk_window_show_now be a better solution than
gdk_display_sync?
Comment 13 Frederic Crozat 2004-10-08 15:58:00 UTC
*** Bug 152923 has been marked as a duplicate of this bug. ***