diff options
author | 2023-05-30 00:58:19 +0200 | |
---|---|---|
committer | 2023-05-30 00:58:19 +0200 | |
commit | 3e723993dbb97b329994bde12a07c1ae6fc29739 (patch) | |
tree | 8eec580d38e13631544dfe6176530a85e4eba2ef /src/window.c | |
parent | 6074643e748aec36f59dfdadeaf54de00f2094aa (diff) | |
download | cherry-3e723993dbb97b329994bde12a07c1ae6fc29739.tar.gz cherry-3e723993dbb97b329994bde12a07c1ae6fc29739.zip |
Fix cherry_window_set_visible
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c index ba5b9b5..491e2b7 100644 --- a/src/window.c +++ b/src/window.c @@ -180,11 +180,16 @@ cherry_window_set_position(CherryWindow *window, int x, int y) void cherry_window_set_visible(CherryWindow *window, int visible) { - CherryApplication *app = cherry_application_get_running_app(); + CherryWidget *widget = (CherryWidget *) window; + cherry_widget_set_visible(widget, visible); + + if (widget->drawn == 0) { + window->draw((CherryWidget *) window); - window->draw((CherryWidget *) window); - if (visible) { - XMapRaised(app->display, window->window_handler); + if (visible) { + CherryApplication *app = cherry_application_get_running_app(); + XMapRaised(app->display, window->window_handler); + } } } |