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_dialog));
+ ui_window_present(GTK_WINDOW(widgets.find_in_files_dialog));
}
Index: src/ui_utils.c
===================================================================
--- src/ui_utils.c (Revision 2552)
+++ src/ui_utils.c (Arbeitskopie)
@@ -29,6 +29,10 @@
#include <string.h>
+#if defined(GDK_WINDOWING_X11) && GTK_CHECK_VERSION(2, 8, 0)
+# include <gdk/gdkx.h>
+#endif
+
#include "ui_utils.h"
#include "prefs.h"
#include "sciwrappers.h"
@@ -1415,3 +1419,20 @@
{
init_document_widgets();
}
+
+
+/* Wrapper function for gtk_window_present() which calls additionally
+ * gdk_x11_window_move_to_current_desktop() on X displays to force the window being shown on
+ * the current desktop.
+ * Based on a patch by Damián Viano, see the full discussion at
+ * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=428020. */
+void ui_window_present(GtkWindow *window)
+{
+ g_return_if_fail(window != NULL);
+
+ gtk_window_present(window);
+
+#if defined(GDK_WINDOWING_X11) && GTK_CHECK_VERSION(2, 8, 0)
+ gdk_x11_window_move_to_current_desktop(GTK_WIDGET(window)->window);
+#endif
+}
pgp95MHF109jP.pgp
Description: PGP signature

