summaryrefslogtreecommitdiff
path: root/plugingui/nativewindow_x11.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-12-02 19:24:57 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2017-01-21 14:51:32 +0100
commitea6883e9ba851db5e6557b1d71d1268f6ab25c64 (patch)
tree7bc0778d2b42a4040552fb44b4b7c011b5f09989 /plugingui/nativewindow_x11.cc
parentb2f7b6be4c6695fa741f2eafaef3af5bce5c30c2 (diff)
Make resize events fdo the right thing. Add move event.
Diffstat (limited to 'plugingui/nativewindow_x11.cc')
-rw-r--r--plugingui/nativewindow_x11.cc26
1 files changed, 19 insertions, 7 deletions
diff --git a/plugingui/nativewindow_x11.cc b/plugingui/nativewindow_x11.cc
index 8a86c80..1ca7d00 100644
--- a/plugingui/nativewindow_x11.cc
+++ b/plugingui/nativewindow_x11.cc
@@ -414,13 +414,25 @@ std::shared_ptr<Event> NativeWindowX11::translateXMessage(XEvent& xevent,
case ConfigureNotify:
{
- auto resizeEvent = std::make_shared<ResizeEvent>();
- resizeEvent->window_id = xevent.xconfigure.window;
- //resizeEvent->x = xevent.xconfigure.x;
- //resizeEvent->y = xevent.xconfigure.y;
- resizeEvent->width = xevent.xconfigure.width;
- resizeEvent->height = xevent.xconfigure.height;
- event = resizeEvent;
+ if((window.width() != (std::size_t)xevent.xconfigure.width) ||
+ (window.height() != (std::size_t)xevent.xconfigure.height))
+ {
+ auto resizeEvent = std::make_shared<ResizeEvent>();
+ resizeEvent->window_id = xevent.xconfigure.window;
+ resizeEvent->width = xevent.xconfigure.width;
+ resizeEvent->height = xevent.xconfigure.height;
+ event = resizeEvent;
+ }
+
+ if((window.windowX() != (std::size_t)xevent.xconfigure.x) ||
+ (window.windowY() != (std::size_t)xevent.xconfigure.y))
+ {
+ auto moveEvent = std::make_shared<MoveEvent>();
+ moveEvent->window_id = xevent.xconfigure.window;
+ moveEvent->x = xevent.xconfigure.x;
+ moveEvent->y = xevent.xconfigure.y;
+ event = moveEvent;
+ }
}
break;