Skip to content

Commit edf811d

Browse files
committed
lstopo/x11: don't reset custom scale to 1. when moving the window
Signed-off-by: Brice Goglin <[email protected]>
1 parent baf4273 commit edf811d

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

utils/lstopo/lstopo-cairo.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright © 2009 CNRS
3-
* Copyright © 2009-2016 Inria. All rights reserved.
3+
* Copyright © 2009-2017 Inria. All rights reserved.
44
* Copyright © 2009-2010, 2014 Université Bordeaux
55
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
66
* See COPYING in top-level directory.
@@ -360,12 +360,15 @@ output_x11(struct lstopo_output *loutput)
360360
float wscale, hscale;
361361
disp->screen_width = e.xconfigure.width;
362362
disp->screen_height = e.xconfigure.height;
363-
wscale = disp->screen_width / (float)disp->width;
364-
hscale = disp->screen_height / (float)disp->height;
365-
disp->scale *= wscale > hscale ? hscale : wscale;
366-
if (disp->scale < 1.0f)
367-
disp->scale = 1.0f;
368-
move_x11(disp);
363+
if (disp->screen_width != disp->last_screen_width
364+
|| disp->screen_height != disp->last_screen_height) {
365+
wscale = disp->screen_width / (float)disp->width;
366+
hscale = disp->screen_height / (float)disp->height;
367+
disp->scale *= wscale > hscale ? hscale : wscale;
368+
if (disp->scale < 1.0f)
369+
disp->scale = 1.0f;
370+
move_x11(disp);
371+
}
369372
if (disp->x != lastx || disp->y != lasty)
370373
XMoveWindow(disp->dpy, disp->win, -disp->x, -disp->y);
371374
break;

0 commit comments

Comments
 (0)