[geany/geany] 3966ba: Query GdkWindow reference only if available

Enrico Tröger git-noreply at xxxxx
Sun Oct 12 14:35:46 UTC 2014


Branch:      refs/heads/master
Author:      Enrico Tröger <enrico.troeger at uvena.de>
Committer:   Enrico Tröger <enrico.troeger at uvena.de>
Date:        Sun, 12 Oct 2014 14:35:46 UTC
Commit:      3966ba8c4b2656c12bed7a5bf96a39eadc49d5a7
             https://github.com/geany/geany/commit/3966ba8c4b2656c12bed7a5bf96a39eadc49d5a7

Log Message:
-----------
Query GdkWindow reference only if available

On startup, the Geany main window doesn't have a GdkWindow yet
(probably because it is not yet mapped). This causes many
'gdkdrawable-win32.c:2013 drawable is not a pixmap or window'
warnings when resolving shortcuts on Windows.
Since we pass the SLR_NO_UI to the Windows API, we probably
don't need the parent hWnd reference at all.


Modified Paths:
--------------
    src/win32.c

Modified: src/win32.c
12 lines changed, 10 insertions(+), 2 deletions(-)
===================================================================
@@ -1474,8 +1474,16 @@ gchar *win32_get_shortcut_target(const gchar *file_name)
 {
 	gchar *path = NULL;
 	wchar_t *wfilename = g_utf8_to_utf16(file_name, -1, NULL, NULL, NULL);
-
-	resolve_link(GDK_WINDOW_HWND(gtk_widget_get_window(main_widgets.window)), wfilename, &path);
+	HWND hWnd = NULL;
+	
+	if (main_widgets.window != NULL)
+	{
+		GdkWindow *window = gtk_widget_get_window(main_widgets.window);
+		if (window != NULL)
+			hWnd = GDK_WINDOW_HWND(window);
+	}
+	
+	resolve_link(hWnd, wfilename, &path);
 	g_free(wfilename);
 
 	if (path == NULL)



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list