summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app.c6
-rw-r--r--src/ui/window.c4
-rw-r--r--src/ui/window.h1
3 files changed, 8 insertions, 3 deletions
diff --git a/src/app.c b/src/app.c
index e9a2c638..90ad271d 100644
--- a/src/app.c
+++ b/src/app.c
@@ -702,7 +702,7 @@ static int resizeWatcher_(void *user, SDL_Event *event) {
702 SDL_Event u = { .type = SDL_USEREVENT }; 702 SDL_Event u = { .type = SDL_USEREVENT };
703 u.user.code = command_UserEventCode; 703 u.user.code = command_UserEventCode;
704 u.user.data1 = strdup("theme.changed"); 704 u.user.data1 = strdup("theme.changed");
705 u.user.windowID = SDL_GetWindowID(d->window->win); 705 u.user.windowID = id_Window(d->window);
706 dispatchEvent_Widget(d->window->root, &u); 706 dispatchEvent_Widget(d->window->root, &u);
707 } 707 }
708#endif 708#endif
@@ -795,7 +795,7 @@ void postRefresh_App(void) {
795 SDL_Event ev; 795 SDL_Event ev;
796 ev.user.type = SDL_USEREVENT; 796 ev.user.type = SDL_USEREVENT;
797 ev.user.code = refresh_UserEventCode; 797 ev.user.code = refresh_UserEventCode;
798 ev.user.windowID = get_Window() ? SDL_GetWindowID(get_Window()->win) : 0; 798 ev.user.windowID = id_Window(get_Window());
799 ev.user.data1 = NULL; 799 ev.user.data1 = NULL;
800 ev.user.data2 = NULL; 800 ev.user.data2 = NULL;
801 SDL_PushEvent(&ev); 801 SDL_PushEvent(&ev);
@@ -820,7 +820,7 @@ void postCommand_App(const char *command) {
820 } 820 }
821 ev.user.type = SDL_USEREVENT; 821 ev.user.type = SDL_USEREVENT;
822 ev.user.code = command_UserEventCode; 822 ev.user.code = command_UserEventCode;
823 ev.user.windowID = get_Window() ? SDL_GetWindowID(get_Window()->win) : 0; 823 ev.user.windowID = id_Window(get_Window());
824 ev.user.data1 = strdup(command); 824 ev.user.data1 = strdup(command);
825 ev.user.data2 = NULL; 825 ev.user.data2 = NULL;
826 SDL_PushEvent(&ev); 826 SDL_PushEvent(&ev);
diff --git a/src/ui/window.c b/src/ui/window.c
index f9e58acb..2062a3bb 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -1055,6 +1055,10 @@ void setCursor_Window(iWindow *d, int cursor) {
1055 d->pendingCursor = d->cursors[cursor]; 1055 d->pendingCursor = d->cursors[cursor];
1056} 1056}
1057 1057
1058uint32_t id_Window(const iWindow *d) {
1059 return d && d->win ? SDL_GetWindowID(d->win) : 0;
1060}
1061
1058iInt2 rootSize_Window(const iWindow *d) { 1062iInt2 rootSize_Window(const iWindow *d) {
1059 return d->root->rect.size; 1063 return d->root->rect.size;
1060} 1064}
diff --git a/src/ui/window.h b/src/ui/window.h
index 9e3f16bc..25d81e6f 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -60,6 +60,7 @@ void setUiScale_Window (iWindow *, float uiScale);
60void setFreezeDraw_Window (iWindow *, iBool freezeDraw); 60void setFreezeDraw_Window (iWindow *, iBool freezeDraw);
61void setCursor_Window (iWindow *, int cursor); 61void setCursor_Window (iWindow *, int cursor);
62 62
63uint32_t id_Window (const iWindow *);
63iInt2 rootSize_Window (const iWindow *); 64iInt2 rootSize_Window (const iWindow *);
64float uiScale_Window (const iWindow *); 65float uiScale_Window (const iWindow *);
65iInt2 coord_Window (const iWindow *, int x, int y); 66iInt2 coord_Window (const iWindow *, int x, int y);