|
From: <mla...@us...> - 2008-01-27 06:58:41
|
Revision: 455
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=455&view=rev
Author: mlampard
Date: 2008-01-26 22:58:43 -0800 (Sat, 26 Jan 2008)
Log Message:
-----------
g15macro: fix a segfault in g15r_initCanvas() when Freetype support is compiled in. For some reason FT_Init_Freetype() doesn't like being called after XOpenDisplay() on my system.
Modified Paths:
--------------
trunk/g15daemon-clients/g15macro/ChangeLog
trunk/g15daemon-clients/g15macro/g15macro.c
Modified: trunk/g15daemon-clients/g15macro/ChangeLog
===================================================================
--- trunk/g15daemon-clients/g15macro/ChangeLog 2008-01-26 05:30:51 UTC (rev 454)
+++ trunk/g15daemon-clients/g15macro/ChangeLog 2008-01-27 06:58:43 UTC (rev 455)
@@ -24,3 +24,6 @@
any of the M keys, and moves repeated code into their own functions.
- Add --help, --keysonly cmdline options. --keysonly configures keymaps
(including multimedia keys) then exits.
+SVN:
+- Move g15r_initCanvas() higher in main() to work around a segfault when
+ libg15render is compiled with FreeType support.
Modified: trunk/g15daemon-clients/g15macro/g15macro.c
===================================================================
--- trunk/g15daemon-clients/g15macro/g15macro.c 2008-01-26 05:30:51 UTC (rev 454)
+++ trunk/g15daemon-clients/g15macro/g15macro.c 2008-01-27 06:58:43 UTC (rev 455)
@@ -843,6 +843,15 @@
}
}
+ canvas = (g15canvas *) malloc (sizeof (g15canvas));
+
+ if (canvas != NULL) {
+ g15r_initCanvas(canvas);
+ } else {
+ printf("Unable to initialise the libg15render canvas\nExiting\n");
+ return 1;
+ }
+
do {
dpy = XOpenDisplay(getenv("DISPLAY"));
if (!dpy) {
@@ -916,21 +925,14 @@
usleep(1000);
g15_send_cmd (g15screen_fd,G15DAEMON_MKEYLEDS,mled_state);
usleep(1000);
- canvas = (g15canvas *) malloc (sizeof (g15canvas));
- if (canvas != NULL) {
- g15r_initCanvas(canvas);
- } else {
- printf("Unable to initialise the libg15render canvas\nExiting\n");
- return 1;
- }
-
root_win = DefaultRootWindow(dpy);
if (!root_win) {
printf("Cant find root window\n");
return 1;
}
+
have_xtest = False;
#ifdef HAVE_XTEST
#ifdef USE_XTEST
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|