From 9be679dad71f81e85d6e55dd11c662b17e73d937 Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 20 Jul 2006 11:16:09 +0000 Subject: allow negative width and height --- src/Screen.cc | 4 ++-- src/Screen.hh | 2 +- src/WinClient.cc | 14 +++++++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index a8f02c2..154dd11 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1841,8 +1841,8 @@ void BScreen::hidePosition() { } } - -void BScreen::showGeometry(unsigned int gx, unsigned int gy) { +// can be negative when base_width/height > min_width/height +void BScreen::showGeometry(int gx, int gy) { if (!doShowWindowPos()) return; diff --git a/src/Screen.hh b/src/Screen.hh index 0a1eaf8..d4aea5e 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -286,7 +286,7 @@ public: void showPosition(int x, int y); void hidePosition(); /// show geomentry with "width x height"-text, not size of window - void showGeometry(unsigned int width, unsigned int height); + void showGeometry(int width, int height); void hideGeometry(); void notifyReleasedKeys(XKeyEvent &ke); diff --git a/src/WinClient.cc b/src/WinClient.cc index 0eddac5..daf3d42 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc @@ -842,11 +842,15 @@ void WinClient::applySizeHints(int &width, int &height, // enforce incremental size limits, wrt base size // only calculate this if we really need to - i = (width - base_width) / width_inc; - width = i*width_inc + base_width; - - j = (height - base_height) / height_inc; - height = j*height_inc + base_height; + i = (width - static_cast(base_width)) / + static_cast(width_inc); + width = i*static_cast(width_inc) + + static_cast(base_width); + + j = (height - static_cast(base_height)) / + static_cast(height_inc); + height = j*static_cast(height_inc) + + static_cast(base_height); if (display_width) *display_width = i; -- cgit v0.11.2