summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/resize.c
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 09:05:22 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 09:05:22 +0000
commita47df6754a3cb37ab8151d839821697f50861d28 (patch)
treea4ab8c669d6bc5c0f70320aa5203fdc2d3426544 /beryl-plugins/src/resize.c
parentde89650b0863c582d1e9b9ace4ee5cf1bc2af576 (diff)
downloadmarex-dev-a47df6754a3cb37ab8151d839821697f50861d28.tar.gz
marex-dev-a47df6754a3cb37ab8151d839821697f50861d28.tar.bz2
resize plugin: properly reflect resize increment hint (closes #1341)
git-svn-id: file:///beryl/trunk@4016 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/resize.c')
-rw-r--r--beryl-plugins/src/resize.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/beryl-plugins/src/resize.c b/beryl-plugins/src/resize.c
index 57824bf..e38e1de 100644
--- a/beryl-plugins/src/resize.c
+++ b/beryl-plugins/src/resize.c
@@ -325,6 +325,18 @@ static void resizeUpdateWindowSize(CompDisplay * d, int dx, int dy)
if (!rd->w)
return;
+ /* reflect resize increment hint properly - do not resize if
+ the resize amout isn't a multiple of this */
+ if (rd->w->sizeHints.flags & PResizeInc) {
+ if ((dx % rd->w->sizeHints.width_inc) != 0)
+ dx = 0;
+ if ((dy % rd->w->sizeHints.height_inc) != 0)
+ dy = 0;
+
+ if (!dx && !dy)
+ return;
+ }
+
if (rd->resizeMode != ResizeModeNormal)
damageScreen(rd->w->screen);