diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-06-03 09:27:26 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-06-03 12:38:44 +0100 |
commit | baa6b7f1a86a0014c9ce176b687bf6ac3edf933d (patch) | |
tree | 1a049303ddf601b4f80f4acaf56655e59d274476 | |
parent | 35bd9b1a37a1819d0c783b302c358bd1352aea40 (diff) |
fdo#56583 - avoid setting user time on unrealized windows.
Change-Id: Iab776088b1d168295d636069e1a92ba948241653
-rw-r--r-- | vcl/unx/gtk/window/gtksalframe.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 041a8a060bac..0f53e935c780 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -1013,9 +1013,17 @@ static void lcl_set_user_time( GtkWindow* i_pWindow, guint32 i_nTime ) bGetSetUserTimeFn = false; p_gdk_x11_window_set_user_time = (setUserTimeFn)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_x11_window_set_user_time" ); } + bool bSet = false; if( p_gdk_x11_window_set_user_time ) - p_gdk_x11_window_set_user_time( widget_get_window(GTK_WIDGET(i_pWindow)), i_nTime ); - else + { + GdkWindow* pWin = widget_get_window(GTK_WIDGET(i_pWindow)); + if( pWin ) // only if the window is realized. + { + p_gdk_x11_window_set_user_time( pWin, i_nTime ); + bSet = true; + } + } + if( !bSet ) { Display* pDisplay = GetGtkSalData()->GetGtkDisplay()->GetDisplay(); Atom nUserTime = XInternAtom( pDisplay, "_NET_WM_USER_TIME", True ); |