Bug#428020: debian bug #428020: Geany's Dialog boxes show up on wrong workspace (was: Mailserver problems?)
On Tue, 6 May 2008 11:13:33 -0300, Damián Viano <[EMAIL PROTECTED]> wrote: Hi, > Btw, I've been looking into #428020 and have some stuff but > I'm not sure if the problem is reproducible with other windows > managers (i.e. the current gnome one, whatever that is, or xfce or > other than fluxbox fwiw)... Have you guys reproduced it? (feel free > to move this to the list if you want) It doesn't happen with the SVN version of xfwm4 (I'm using it and tested at the time when this bug was reported and tested now again). I also installed a fresh Lenny with Gnome 2.22.1 and I wasn't able to reproduce it there too. > I attach a patch that fix most of this problems, except for > the fonts dialog launched from the font buttons in the preference > dialog, which I don't know how can be fixed without rewriting the > handler for the click in that buttons. One solution would be to use a normal GtkButton and create the font dialog manually with a own click handler (i.e. re-use the code for the font dialog in dialogs.c). > I'm still not too sure if adding the > gdk_x11_window_move_to_current_desktop() call manually is the best > way to handle it, but since I was trying if it worked I have the > patch around :-) So you can reproduce it? Attached is a modified version of your patch which adds ui_window_present() as a wrapper for gtk_window_present(). And it calls gdk_x11_window_move_to_current_desktop() only when compiled on systems with X to not break Windows/MacOSX support. Not sure whether I really got the point but it seems more like a window manager issue than a bug in Geany, IMO. So, I'm not very keen on fixing window manager problems in Geany... Regards, Enrico -- Get my GPG key from http://www.uvena.de/pub.asc Index: src/ui_utils.h === --- src/ui_utils.h (Revision 2552) +++ src/ui_utils.h (Arbeitskopie) @@ -175,4 +175,6 @@ void ui_statusbar_showhide(gboolean state); +void ui_window_present(GtkWindow *window); + #endif Index: src/tools.c === --- src/tools.c (Revision 2552) +++ src/tools.c (Arbeitskopie) @@ -767,7 +767,7 @@ } /* We make sure the dialog is visible. */ - gtk_window_present(GTK_WINDOW(ui_widgets.open_colorsel)); + ui_window_present(GTK_WINDOW(ui_widgets.open_colorsel)); #endif } Index: src/prefs.c === --- src/prefs.c (Revision 2552) +++ src/prefs.c (Arbeitskopie) @@ -1477,7 +1477,7 @@ } prefs_init_dialog(); - gtk_widget_show(ui_widgets.prefs_dialog); + ui_window_present(GTK_WINDOW(ui_widgets.prefs_dialog)); } Index: src/dialogs.c === --- src/dialogs.c (Revision 2552) +++ src/dialogs.c (Arbeitskopie) @@ -267,7 +267,7 @@ } gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(ui_widgets.open_filesel)); - gtk_widget_show(ui_widgets.open_filesel); + ui_window_present(GTK_WINDOW(ui_widgets.open_filesel)); #endif g_free(initdir); } @@ -566,6 +566,9 @@ if (! folder_set && initdir != NULL && g_path_is_absolute(initdir)) gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(ui_widgets.save_filesel), initdir); + /* ensure the dialog is visible */ + ui_window_present(GTK_WINDOW(ui_widgets.save_filesel)); + /* Run the dialog synchronously, pausing this function call */ resp = gtk_dialog_run(GTK_DIALOG(ui_widgets.save_filesel)); return (resp == GTK_RESPONSE_ACCEPT); @@ -788,7 +791,7 @@ gtk_window_set_transient_for(GTK_WINDOW(ui_widgets.open_fontsel), GTK_WINDOW(app->window)); } /* We make sure the dialog is visible. */ - gtk_window_present(GTK_WINDOW(ui_widgets.open_fontsel)); + ui_window_present(GTK_WINDOW(ui_widgets.open_fontsel)); #endif } Index: src/search.c === --- src/search.c (Revision 2552) +++ src/search.c (Arbeitskopie) @@ -392,7 +392,7 @@ gtk_widget_grab_focus(GTK_WIDGET(GTK_BIN(lookup_widget(widgets.find_dialog, "entry"))->child)); gtk_widget_show(widgets.find_dialog); /* bring the dialog back in the foreground in case it is already open but the focus is away */ - gtk_window_present(GTK_WINDOW(widgets.find_dialog)); + ui_window_present(GTK_WINDOW(widgets.find_dialog)); } g_free(sel); } @@ -537,7 +537,7 @@ gtk_widget_grab_focus(GTK_WIDGET(GTK_BIN(lookup_widget(widgets.replace_dialog, "entry_find"))->child)); gtk_widget_show(widgets.replace_dialog); /* bring the dialog back in the foreground in case it is already open but the focus is away */ - gtk_window_present(GTK_WINDOW(widgets.replace_dialog)); + ui_window_present(GTK_WINDOW(widgets.replace_dialog)); } g_free(sel); } @@ -744,7 +744,7 @@ gtk_widget_show(widgets.find_in_files_dialog); /* bring the dialog back in the foreground in case it is already open but the focus is away */ - gtk_window_present(GTK_WINDOW(widgets.find_in_files_dialo
Bug#428020: debian bug #428020: Geany's Dialog boxes show up on wrong workspace (was: Mailserver problems?)
On Sat, May 03, 2008 at 08:28:46PM +0200, Enrico Tröger wrote: > Hi > > today I noticed in uvena.de's mail queue there are some mails for you > but they can't be delivered because of the following error: > > connect to mail.damianv.com.ar[190.55.82.29]:25: No route to host > > So, is this a temporary problem or is the server/network down? It was a temporary problem, fixed now, and for once I added a secondary MX to my domain, so shouldn't happen any more. > Btw, thanks for the Geany 0.14 package ;-). Sure, no problem. Btw, I've been looking into #428020 and have some stuff but I'm not sure if the problem is reproducible with other windows managers (i.e. the current gnome one, whatever that is, or xfce or other than fluxbox fwiw)... Have you guys reproduced it? (feel free to move this to the list if you want) I attach a patch that fix most of this problems, except for the fonts dialog launched from the font buttons in the preference dialog, which I don't know how can be fixed without rewriting the handler for the click in that buttons. AFAIS the problem comes from two bugs in gtk/gdk, [1] and [2] which basically ended in the addition of gdk_x11_window_move_to_current_desktop() and after some fiddling NOT calling it in gtk_window_present(). So the patch basically adds a gdk_x11_window_move_to_current_desktop() call after those gtk_window_present() affected by this, and replaces some gtk_widget_show for the present+move_to_current combo also. I'm still not too sure if adding the gdk_x11_window_move_to_current_desktop() call manually is the best way to handle it, but since I was trying if it worked I have the patch around :-) Hope it helps. [1] http://bugzilla.gnome.org/show_bug.cgi?id=166379 this is where all this activation stuff first showed problems [2] http://bugzilla.gnome.org/show_bug.cgi?id=311653 this is where they remove the gdk_x11_window_move_to_current_desktop() call from gtk_window_present() Other references: http://svn.gnome.org/viewvc/gtk%2B/trunk/gdk/x11/gdkwindow-x11.c?revision=19372&view=markup search for gdk_x11_window_move_to_current_desktop to see the code for that http://svn.gnome.org/viewvc/gtk%2B/trunk/gtk/gtkfontbutton.c?revision=19708&view=markup same for gtk_font_button_clicked which have two matches where the font buttons get this as a callback for clicked and the code for it in which the dialog is shown using gtk_window_present which is why is not coming to the current desktop PS: I decided to CC the bug since I haven't given any feedback to our helpful reporter yet. -- Damián Viano(Des) ¯ ¯ - _ _ - ¯ ¯ GPG: 0x6EB95A6F Debian ¯-_GNU_-¯ Linux Web: http://damianv.com.ar/ ¯-¯ Index: src/tools.c === --- src/tools.c (revision 2550) +++ src/tools.c (working copy) @@ -32,6 +32,7 @@ #include #include #include +#include #ifdef G_OS_UNIX # include @@ -768,6 +769,7 @@ /* We make sure the dialog is visible. */ gtk_window_present(GTK_WINDOW(ui_widgets.open_colorsel)); + gdk_x11_window_move_to_current_desktop(ui_widgets.open_colorsel->window); #endif } Index: src/prefs.c === --- src/prefs.c (revision 2550) +++ src/prefs.c (working copy) @@ -28,6 +28,7 @@ #include #include #include +#include #include "geany.h" @@ -1477,7 +1478,9 @@ } prefs_init_dialog(); - gtk_widget_show(ui_widgets.prefs_dialog); + /* We make sure the dialog is visible. */ + gtk_window_present(GTK_WINDOW(ui_widgets.prefs_dialog)); + gdk_x11_window_move_to_current_desktop(ui_widgets.prefs_dialog->window); } Index: src/dialogs.c === --- src/dialogs.c (revision 2550) +++ src/dialogs.c (working copy) @@ -28,6 +28,7 @@ #include "geany.h" #include +#include #include #ifdef HAVE_SYS_STAT_H # include @@ -267,7 +268,9 @@ } gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(ui_widgets.open_filesel)); - gtk_widget_show(ui_widgets.open_filesel); + /* We make sure the dialog is visible. */ + gtk_window_present(GTK_WINDOW(ui_widgets.open_filesel)); + gdk_x11_window_move_to_current_desktop(ui_widgets.open_filesel->window); #endif g_free(initdir); } @@ -566,6 +569,9 @@ if (! folder_set && initdir != NULL && g_path_is_absolute(initdir)) gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(ui_widgets.save_filesel), initdir); + /* We make sure the dialog is visible. */ + gtk_window_present(GTK_WINDOW(ui_widgets.save_filesel)); + gdk_x11_window_move_to_current_desktop(ui_widgets.save_filesel->window); /* Run the dialog synchronously, pausing this function call */ resp = gtk_dialog_run(GTK_DIALOG(ui_widgets.save_filesel)); return (resp == GTK_RESPONSE_ACCEPT); @@ -789,6 +795,7 @@ } /* We make sure the dialog is visible. */ gtk_window_present(GTK_WINDOW(ui_