DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2713
Version: 1.3.0
Many applications use hyphenated .desktop file names and/or WM_CLASS
values. In order for Gnome Shell to be able to associate windows with
their respective applications (and therefore for the shortcuts sidebar to
work correctly), these two things need to match.
FLTK currently truncates xclass at the first non-alphanumeric character,
which breaks compatibility with Gnome Shell for applications which use
hyphenated .desktop file names. The attached patch prevents this from
happening, and leaves it up to the developer to use a sensible naming
convention if they want to avoid breaking XResource lookups.
Link: http://www.fltk.org/str.php?L2713
Version: 1.3.0
--- src/Fl_x.cxx.orig 2011-09-16 11:43:40.000000000 +0200
+++ src/Fl_x.cxx 2011-09-19 12:27:19.000000000 +0200
@@ -1732,16 +1732,17 @@
// set the class property, which controls the icon used:
if (win->xclass()) {
char buffer[1024];
- char *p; const char *q;
- // truncate on any punctuation, because they break XResource lookup:
- for (p = buffer, q = win->xclass(); isalnum(*q)||(*q&128);) *p++ = *q++;
- *p++ = 0;
+ const char *xclass = win->xclass();
+ const int len = strlen(xclass);
+ // duplicate the xclass string for use as XA_WM_CLASS
+ strcpy(buffer, xclass);
+ strcpy(buffer + len + 1, xclass);
// create the capitalized version:
- q = buffer;
- *p = toupper(*q++); if (*p++ == 'X') *p++ = toupper(*q++);
- while ((*p++ = *q++));
+ buffer[len + 1] = toupper(buffer[len + 1]);
+ if (buffer[len + 1] == 'X')
+ buffer[len + 2] = toupper(buffer[len + 2]);
XChangeProperty(fl_display, xp->xid, XA_WM_CLASS, XA_STRING, 8, 0,
- (unsigned char *)buffer, p-buffer-1);
+ (unsigned char *)buffer, len * 2 + 2);
}
if (win->non_modal() && xp->next && !fl_disable_transient_for) {
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs