Xwayland: Don't notify RR of an unchanged size

Submitted by Preston Carpenter on April 17, 2018, 10:44 p.m.

Details

Message ID 20180417224426.3055-1-APragmaticPlace@gmail.com
State New
Headers show
Series "Xwayland: Don't notify RR of an unchanged size" ( rev: 1 ) in X.org

Not browsing as part of any series.

Commit Message

Preston Carpenter April 17, 2018, 10:44 p.m.
From: Timidger <APragmaticPlace@gmail.com>

On Wayland compositors such as Sway and Way Cooler Xwayland windows will
be scaled twice if a TTY change occurs. This is due to sending the
output mode information twice, causing it to be applied twice to RandR.

This patch does not notify RandR if the size did not change, covering
the case where a TTY was suspended and then later resumed.

Signed-off-by: Timidger <APragmaticPlace@gmail.com>
---
 hw/xwayland/xwayland-output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index 48faeb142..dc988ed2f 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -194,7 +194,7 @@  update_screen_size(struct xwl_output *xwl_output, int width, int height)
 
     SetRootClip(xwl_screen->screen, xwl_screen->root_clip_mode);
 
-    if (xwl_screen->screen->root) {
+    if (xwl_screen->screen->root && xwl_output->width != width && xwl_output->height != height) {
         BoxRec box = { 0, 0, width, height };
 
         xwl_screen->screen->root->drawable.width = width;

Comments

On Tue, 2018-04-17 at 18:44 -0400, Preston Carpenter wrote:
> From: Timidger <APragmaticPlace@gmail.com>
> 
> On Wayland compositors such as Sway and Way Cooler Xwayland windows will
> be scaled twice if a TTY change occurs. This is due to sending the
> output mode information twice, causing it to be applied twice to RandR.

I don't understand this. If you get two events in a row telling you the
display is the same size, why does the second one do something
different than the first?

- ajax
On Tue, Apr 17, 2018 at 3:44 PM, Preston Carpenter
<apragmaticplace@gmail.com> wrote:
> From: Timidger <APragmaticPlace@gmail.com>

Do you mind using your real name?