diff options
author | 2023-05-30 00:49:01 +0200 | |
---|---|---|
committer | 2023-05-30 00:49:01 +0200 | |
commit | 80f959733fb7cc7e2e86a3e462496cc17e482bcf (patch) | |
tree | c96fec4ffaa3096998ffdeb3bda715928e4bc185 /src/window.c | |
parent | e699edc5c53cf77dec04ceecc1ceb03cb1eb3920 (diff) | |
download | cherry-80f959733fb7cc7e2e86a3e462496cc17e482bcf.tar.gz cherry-80f959733fb7cc7e2e86a3e462496cc17e482bcf.zip |
Update position and dimension only if the window
is drawn
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c index 10f4766..c69b265 100644 --- a/src/window.c +++ b/src/window.c @@ -142,8 +142,10 @@ cherry_window_set_dimension(CherryWindow *window, int width, int height) CherryWidget *widget = (CherryWidget *) window; cherry_widget_set_dimension(widget, width, height); - if (cherry_widget_is_visible(widget)) { + if (widget->drawn) { int x, y; + cherry_widget_get_position(widget, &x, &y); + CherryApplication *app = cherry_application_get_running_app(); XMoveResizeWindow(app->display, window->window_handler, x, y, @@ -164,6 +166,15 @@ cherry_window_set_position(CherryWindow *window, int x, int y) CherryWidget *widget = (CherryWidget *) window; cherry_widget_set_position(widget, x, y); + if (widget->drawn) { + int width, height; + cherry_widget_get_dimension(widget, &width, &height); + + CherryApplication *app = cherry_application_get_running_app(); + XMoveResizeWindow(app->display, window->window_handler, + x, y, + width, height); + } } void |