mirror of
https://github.com/fltk/fltk.git
synced 2026-05-24 00:06:20 +08:00
STR 2713: less restrictive XClass handling.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9110 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+9
-8
@@ -1748,16 +1748,17 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap)
|
||||
// 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) {
|
||||
|
||||
Reference in New Issue
Block a user