The patch below implements a -U option that does exactly what I want re:
fullscreen.

It allows fullscreen to not take over from the window manager.

I also strongly disagree with the author's past comments, given that the
current behavious breaks X standards, as per the comment in the code:

//  TEMP is definitely the wrong thing to use: 
http://developer.gnome.org/doc/GGAD/sec-gdkwindow.html
         attr.window_type=GDK_WINDOW_TEMP;

That webpage shows: "GDK_WINDOW_TEMP is used for popup menus and the like;
it's a window that will exist only *briefly*."  (my emphasis)


man page has been updated.

Patch is not 100% ideal -- I don't know why the image is not refreshed
upon being reexposed when in fullscreen, but is refreshed properly when
not fullscreen.  I have a horrible hack to get it to display properly in
that case.

I'm sure an X hacker can find a better solution than myself -- that's
pretty much the first time I have dealt with an X app :)


Common subdirectories: qiv-2.0/debian and qiv-2.0.fullscreen/debian
diff -u qiv-2.0/event.c qiv-2.0.fullscreen/event.c
--- qiv-2.0/event.c     2004-04-20 05:34:39.000000000 +1000
+++ qiv-2.0.fullscreen/event.c  2005-09-10 20:32:30.000000000 +1000
@@ -160,6 +160,9 @@
                q->exposed = 1;
         qiv_set_cursor_timeout(q);
          }
+          if (fullscreen && fullscreen_obey_wm) {    //temporary horrible 
hack: doesnt redraw otherwise when reexposd in fullscreen.  Does cause flicker 
when first displaying an image...  How to solve properly?  Why does the screen 
redraw automatically when the non-fullscreen window is reexposed?
+               update_image(q, FULL_REDRAW);
+          }
          break;

     case GDK_BUTTON_PRESS:
Only in qiv-2.0.fullscreen: event.o
diff -u qiv-2.0/image.c qiv-2.0.fullscreen/image.c
--- qiv-2.0/image.c     2004-05-07 15:56:01.000000000 +1000
+++ qiv-2.0.fullscreen/image.c  2005-09-10 20:43:24.000000000 +1000
@@ -106,6 +106,7 @@
 {
   GdkWindowAttr attr;
   GdkPixmap *cursor_pixmap;
+  GdkWMDecoration decorations;

   if (!fullscreen) {
     attr.window_type=GDK_WINDOW_TOPLEVEL;
@@ -117,6 +118,12 @@
     attr.height = q->win_h;
     q->win = gdk_window_new(NULL, &attr, GDK_WA_X|GDK_WA_Y);

+    if (fullscreen_obey_wm) {
+//       gtk_window_set_decorated(q->win, gTrue); //only gtk2
+         decorations=GDK_DECOR_ALL;
+         gdk_window_set_decorations (q->win, decorations);
+    }
+
     if (center) {
       gdk_window_set_hints(q->win,
         q->win_x, q->win_y, q->win_w, q->win_h, q->win_w, q->win_h,
@@ -135,14 +142,25 @@
     gdk_window_show(q->win);

   } else { /* fullscreen */
-
-    attr.window_type=GDK_WINDOW_TEMP;
+    if (fullscreen_obey_wm) {
+         attr.window_type=GDK_WINDOW_TOPLEVEL;
+    } else {
+//  TEMP is definitely the wrong thing to use: 
http://developer.gnome.org/doc/GGAD/sec-gdkwindow.html
+         attr.window_type=GDK_WINDOW_TEMP;
+    }
     attr.wclass=GDK_INPUT_OUTPUT;
     attr.event_mask=GDK_ALL_EVENTS_MASK;
     attr.x = attr.y = 0;
     attr.width=screen_x;
     attr.height=screen_y;
     q->win = gdk_window_new(NULL, &attr, GDK_WA_X|GDK_WA_Y);
+
+    if (fullscreen_obey_wm) {
+//       gtk_window_set_decorated(q->win, gFalse); //only gtk2
+         decorations=0;
+         gdk_window_set_decorations (q->win, decorations);
+    }
+
     gdk_window_set_cursor(q->win, cursor);
     gdk_window_show(q->win);
   }
Only in qiv-2.0.fullscreen: image.o
Common subdirectories: qiv-2.0/lib and qiv-2.0.fullscreen/lib
Only in qiv-2.0.fullscreen: main.c.3
diff -u qiv-2.0/main.h qiv-2.0.fullscreen/main.h
--- qiv-2.0/main.h      2004-04-19 16:47:19.000000000 +1000
+++ qiv-2.0.fullscreen/main.h   2005-09-10 20:19:36.000000000 +1000
@@ -33,6 +33,7 @@
 int    random_order; /* TRUE if random delay in slideshow */
 int    random_replace = 1; /* random with replacement by default */
 int    fullscreen; /* TRUE if fullscreen mode */
+int     fullscreen_obey_wm; /* TRUE if we want to not do silly things with the 
window manager when fullscreen */
 int    maxpect; /* TRUE if autozoom (fit-to-screen) mode */
 int    statusbar_fullscreen = 1; /* TRUE if statusbar in fullscreen is turned 
on (default) */
 int    statusbar_window = 0; /* FALSE if statusbar in window is turned off 
(default) */
Only in qiv-2.0.fullscreen: main.o
diff -u qiv-2.0/options.c qiv-2.0.fullscreen/options.c
--- qiv-2.0/options.c   2004-01-08 23:15:08.000000000 +1100
+++ qiv-2.0.fullscreen/options.c        2005-09-10 20:21:33.000000000 +1000
@@ -22,7 +22,7 @@
 extern int rreaddir(const char *);
 extern int rreadfile(const char *);

-static char *short_options = "hexyzmtb:c:g:niIpaGA:vo:srRSd:u:fw:W:PMNF:T";
+static char *short_options = "hexyzmtb:c:g:niIpaGA:vo:srRSd:u:fUw:W:PMNF:T";
 static struct option long_options[] =
 {
     {"help",             0, NULL, 'h'},
@@ -50,6 +50,7 @@
     {"shuffle",          0, NULL, 'S'},
     {"delay",            1, NULL, 'd'},
     {"fullscreen",       0, NULL, 'f'},
+    {"fullscreen_obey_wm",0, NULL, 'U'},
     {"fixed_width",      1, NULL, 'w'},
     {"fixed_zoom",       1, NULL, 'W'},
     {"ignore_path_sort", 0, NULL, 'P'},
@@ -228,9 +229,9 @@
                      break;
            case 'p': transparency=1;
                      break;
-           case 'a': do_grab=1;
+           case 'a': do_grab^=1;
                      break;
-           case 'G': disable_grab=1;
+           case 'G': disable_grab^=1;
                      break;
         case 'A': snprintf(select_dir, sizeof select_dir, "%s", optarg);
               break;
@@ -264,6 +265,9 @@
                      break;
            case 'f': fullscreen=1;
                      break;
+            case 'U': fullscreen_obey_wm=1;
+                 disable_grab=1;  //the original need for enable_grab seems to 
be an effect of the broken fullscreen implimentation
+                      break;
            case 'w': q->win_w = fixed_window_size = checked_atoi(optarg);
                      break;
            case 'W': fixed_zoom_factor = (checked_atoi(optarg) - 100) / 10;
Only in qiv-2.0.fullscreen: options.o
Only in qiv-2.0.fullscreen: qiv
diff -u qiv-2.0/qiv.1 qiv-2.0.fullscreen/qiv.1
--- qiv-2.0/qiv.1       2004-05-22 17:23:53.000000000 +1000
+++ qiv-2.0.fullscreen/qiv.1    2005-09-10 20:23:06.000000000 +1000
@@ -84,10 +84,10 @@
 Enable transparency for transparent images.
 .TP
 .B \-a, \-\-do_grab
-Grab the pointer in windowed mode.
+Toggle grabbing the pointer in windowed mode.
 .TP
 .B \-G, \-\-disable_grab
-Disable grabbing the pointer/kbd in fullscreen mode. Useful e.g. if
+Toggle grabbing the pointer/kbd in fullscreen mode. Useful e.g. if
 qiv displays images on a display other than where it was envoked
 from. Use with caution!
 .TP
@@ -116,6 +116,12 @@
 .B \-f, \-\-fullscreen
 Use fullscreen window on start-up.
 .TP
+.B \-U, \-\-fullscreen_obey_wm
+When fullscreen, do treat the window specially, so the window manager
+can still do its job.  Should be on by default, but off because some
+window managers insist on putting their crap above our window.
+Implies \fI-G\fR.
+.TP
 .B \-P, \-\-ignore_path_sort
 Sort all the image files by just their filename, ignoring the path.
 .TP
diff -u qiv-2.0/qiv.h qiv-2.0.fullscreen/qiv.h
--- qiv-2.0/qiv.h       2004-05-22 17:24:07.000000000 +1000
+++ qiv-2.0.fullscreen/qiv.h    2005-09-10 20:46:08.000000000 +1000
@@ -83,6 +83,7 @@
 extern int             random_order;
 extern int             random_replace;
 extern int             fullscreen;
+extern int             fullscreen_obey_wm;
 extern int             maxpect;
 extern int             statusbar_fullscreen;
 extern int             statusbar_window;
Only in qiv-2.0.fullscreen: qiv_2.0-4.diff.gz
Only in qiv-2.0.fullscreen: qiv_2.0-4.dsc
Only in qiv-2.0.fullscreen: qiv_2.0.orig.tar.gz
Only in qiv-2.0.fullscreen: utils.o

-- 
TimC -- http://http://astronomy.swin.edu.au/staff/tconnors/

>Cats are intended to teach us that not everything in nature has a function.
You're saying cats are the opposite of bijectiveness?
        -- ST in RHOD



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to