summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo2009-02-21 07:31:13 +0000
committerleo2009-02-21 07:31:13 +0000
commit98288502360f565f018b15e3437f8bc5a88c614e (patch)
tree203e3a3c70d12fb78d6c7b1d7cb02c75a885255c
parent4ea1acc83c83d2e9db163b50e02ae4ff2d07df6b (diff)
Fixed gdk runtime warnings.
git-svn-id: http://svn.leocad.org/tags/leocad-0.75@737 c7d43263-9d01-0410-8a33-9dba5d9f93d6
-rw-r--r--linux/system.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/linux/system.cpp b/linux/system.cpp
index 6568ad3..cd70493 100644
--- a/linux/system.cpp
+++ b/linux/system.cpp
@@ -688,17 +688,22 @@ void SystemDoPopupMenu(int nMenu, int x, int y)
void SystemDoWaitCursor(int code)
{
+ GdkWindow* window = ((GtkWidget*)(*main_window))->window;
+
+ if (!GDK_IS_WINDOW(window))
+ return;
+
if (code == 1)
{
- GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
- gdk_window_set_cursor (((GtkWidget*)(*main_window))->window, cursor);
- gdk_cursor_destroy (cursor);
+ GdkCursor *cursor = gdk_cursor_new(GDK_WATCH);
+ gdk_window_set_cursor(window, cursor);
+ gdk_cursor_destroy(cursor);
}
else
{
- GdkCursor *cursor = gdk_cursor_new (GDK_LEFT_PTR);
- gdk_window_set_cursor (((GtkWidget*)(*main_window))->window, cursor);
- gdk_cursor_destroy (cursor);
+ GdkCursor *cursor = gdk_cursor_new(GDK_LEFT_PTR);
+ gdk_window_set_cursor(window, cursor);
+ gdk_cursor_destroy(cursor);
}
}