summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-06-03 09:27:26 +0100
committerPetr Mladek <pmladek@suse.cz>2013-06-03 12:12:37 +0000
commit8fc65f9095bb95692afb1d7522d4d5765dbb3658 (patch)
treef77df79704146775170a541f27ec15b8ce9fcfd2
parentc71f5d5d729e3698d3b6ed4fc41d83ac6bdcb621 (diff)
fdo#56583 - avoid setting user time on unrealized windows.
Change-Id: Iab776088b1d168295d636069e1a92ba948241653 Reviewed-on: https://gerrit.libreoffice.org/4142 Reviewed-by: Petr Mladek <pmladek@suse.cz> Tested-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 36be0b223c41..47aa654d5b8a 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -822,9 +822,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 );