-
Notifications
You must be signed in to change notification settings - Fork 13
Description
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);