forked from pool/tigervnc
8493eddf3d
- u_tigervnc-use_preferred_mode.patch * Mark user chosen resolution as preferred. (bnc#896540) OBS-URL: https://build.opensuse.org/request/show/255665 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/tigervnc?expand=0&rev=40
49 lines
1.6 KiB
Diff
49 lines
1.6 KiB
Diff
Author: Michal Srb <msrb@suse.com>
|
|
Subject: Use preferred mode.
|
|
Patch-Mainline: To be upstreamed
|
|
References: bnc#896540
|
|
|
|
If there is any resolution specified with -geometry or -screen parameters,
|
|
report this resolution as preferred one. That way desktop environments won't
|
|
change it immediately after start.
|
|
Index: unix/xserver/hw/vnc/xvnc.cc
|
|
===================================================================
|
|
--- unix/xserver/hw/vnc/xvnc.cc (revision 5186)
|
|
+++ unix/xserver/hw/vnc/xvnc.cc (working copy)
|
|
@@ -1319,12 +1319,22 @@
|
|
/* Make sure the CRTC has this output set */
|
|
vncRandRCrtcSet(pScreen, crtc, NULL, 0, 0, RR_Rotate_0, 1, &output);
|
|
|
|
- /* Populate a list of default modes */
|
|
- RRModePtr modes[sizeof(vncRandRWidths)/sizeof(*vncRandRWidths)];
|
|
- int num_modes;
|
|
+ /* Populate a list of modes */
|
|
+ RRModePtr modes[sizeof(vncRandRWidths)/sizeof(*vncRandRWidths) + 1];
|
|
+ int num_modes = 0;
|
|
|
|
- num_modes = 0;
|
|
+ /* Start with requested mode */
|
|
+ mode = vncRandRModeGet(pScreen->width, pScreen->height);
|
|
+ if(mode != NULL) {
|
|
+ modes[num_modes] = mode;
|
|
+ num_modes++;
|
|
+ }
|
|
+
|
|
+ /* Add default modes */
|
|
for (int i = 0;i < sizeof(vncRandRWidths)/sizeof(*vncRandRWidths);i++) {
|
|
+ if (vncRandRWidths[i] == pScreen->width && vncRandRHeights[i] == pScreen->height)
|
|
+ continue;
|
|
+
|
|
mode = vncRandRModeGet(vncRandRWidths[i], vncRandRHeights[i]);
|
|
if (mode != NULL) {
|
|
modes[num_modes] = mode;
|
|
@@ -1332,7 +1342,7 @@
|
|
}
|
|
}
|
|
|
|
- RROutputSetModes(output, modes, num_modes, 0);
|
|
+ RROutputSetModes(output, modes, num_modes, 1);
|
|
|
|
return crtc;
|
|
}
|