Skip to content

Image window can unexpectedly move from non-visible desktop to current desktop #34

@auouymous

Description

@auouymous

I have multiple virtual desktop areas on each monitor. All xv image windows on all monitors randomly move to the current area on each monitor. It has happened a couple times when opening a new instance of xv, but usually happens when I unlock the computer in the morning. Sometimes it is everyday, but it can also go several days before moving them.

@william8000 The last hunk in 7cecc1d from #23 is causing the issue, and commenting it out eliminates the moving. I don't know why RRScreenChangeNotify would trigger when opening a new instance, nor do I know why it only triggers sometimes when the monitors powerup. An image window in a different area has coordinates that place it outside the current area, with those coordinates always being relative to the current area.

I assume that code is designed to adapt the image window to changes in monitor size. However, if that is its function, it places them half off the side of the screen in this case. Perhaps compare old dispWIDE/HIGH with new dispWIDE/HIGH, and only reposition if they changed? It also doesn't reposition the visual schnauzer window, and maybe other windows, which might also be offscreen on a smaller monitor. So I'm not entirely sure of its function.

@@ -918,11 +926,24 @@ int HandleEvent(event, donep)
     }
     break;
 
-
-
   default: break;      /* ignore unexpected events */
   }  /* switch */
 
+#ifdef HAVE_XRR
+  if (event->type == RRevent_number + RRScreenChangeNotify) {
+    XRRUpdateConfiguration(event);
+    XSync (theDisp, False);
+    xrr_event = (XRRScreenChangeNotifyEvent *)event;
+
+    screen = XRRRootToScreen(theDisp, xrr_event->window);
+
+    dispWIDE = DisplayWidth(theDisp, screen);
+    dispHIGH = DisplayHeight(theDisp, screen);
+    maxWIDE = vrWIDE = dispWIDE;  maxHIGH = vrHIGH = dispHIGH;
+    HandleDispMode();
+  }
+#endif
+
   frominterrupt = 0;
   *donep = done;
   return(retval);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions