tags 303532 patch
thanks

I think that adding "pspresent: " to the window name would be
sufficient to identify the pspresent window. This is what the
attached patch does.

-- 
Vincent Lefèvre <[EMAIL PROTECTED]> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
--- pspresent.c.old     2003-09-14 13:31:53.000000000 +0200
+++ pspresent.c 2005-04-08 13:15:46.444580618 +0200
@@ -349,7 +349,7 @@
 {
        XSetWindowAttributes attribs;
        Bool override_redirect = True, force_orientation = False;
-       char *filename, *document;
+       char *filename, *wm_name, *document;
        int gs_fd, depth, c;
        int orientation, arg_orientation;
        int bounds[4];
@@ -475,7 +475,17 @@
        gc = XCreateGC(display, display_wnd, 0, NULL);
 
        HideDecorations(display_wnd);
-       XStoreName(display, display_wnd, filename);
+
+       wm_name = malloc(strlen(filename) + 12);
+       if (wm_name == NULL)
+       {
+               fprintf(stderr, "ERROR: not enough memory\n");
+               return EXIT_FAILURE;
+       }
+       strcpy(wm_name, "pspresent: ");
+       strcat(wm_name, filename);
+       XStoreName(display, display_wnd, wm_name);
+
        XMapWindow(display, display_wnd);
        XSelectInput(display, display_wnd, KeyPressMask | ButtonPressMask | 
ButtonReleaseMask | ExposureMask);
 

Reply via email to