[gimp] Use gtk_widget_get_toplevel() to get to a display's "iconified" state
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Use gtk_widget_get_toplevel() to get to a display's "iconified" state
- Date: Tue, 29 Sep 2009 18:36:08 +0000 (UTC)
commit 639c42742989d7ab570d34863ac52b67593ab346
Author: Michael Natterer <mitch gimp org>
Date: Wed Sep 23 15:14:53 2009 +0200
Use gtk_widget_get_toplevel() to get to a display's "iconified" state
Don't assume that shell->window is the toplevel GdkWindow, go thorugh
gtk_widget_get_toplevel() instead.
app/display/gimpdisplay-foreach.c | 5 +++--
app/display/gimpdisplayshell-progress.c | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/app/display/gimpdisplay-foreach.c b/app/display/gimpdisplay-foreach.c
index 1abbec4..661f6b1 100644
--- a/app/display/gimpdisplay-foreach.c
+++ b/app/display/gimpdisplay-foreach.c
@@ -246,8 +246,9 @@ gimp_displays_get_num_visible (Gimp *gimp)
if (GTK_WIDGET_DRAWABLE (display->shell))
{
- GdkWindow *window = gtk_widget_get_window (display->shell);
- GdkWindowState state = gdk_window_get_state (window);
+ GtkWidget *toplevel = gtk_widget_get_toplevel (display->shell);
+ GdkWindow *window = gtk_widget_get_window (toplevel);
+ GdkWindowState state = gdk_window_get_state (window);
if ((state & (GDK_WINDOW_STATE_WITHDRAWN |
GDK_WINDOW_STATE_ICONIFIED)) == 0)
diff --git a/app/display/gimpdisplayshell-progress.c b/app/display/gimpdisplayshell-progress.c
index 1397e74..79aecc2 100644
--- a/app/display/gimpdisplayshell-progress.c
+++ b/app/display/gimpdisplayshell-progress.c
@@ -162,10 +162,11 @@ gimp_display_shell_progress_message (GimpProgress *progress,
static gboolean
gimp_display_shell_is_iconified (GimpDisplayShell *shell)
{
- GtkWidget *widget = GTK_WIDGET (shell);
+ GtkWidget *widget = GTK_WIDGET (shell);
+ GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
return (GTK_WIDGET_DRAWABLE (widget) &&
- gdk_window_get_state (gtk_widget_get_window (widget)) ==
+ gdk_window_get_state (gtk_widget_get_window (toplevel)) ==
GDK_WINDOW_STATE_ICONIFIED);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]