diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/app.c | 6 | ||||
-rw-r--r-- | src/ui/window.c | 4 | ||||
-rw-r--r-- | src/ui/window.h | 1 |
3 files changed, 8 insertions, 3 deletions
@@ -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 | ||
1058 | uint32_t id_Window(const iWindow *d) { | ||
1059 | return d && d->win ? SDL_GetWindowID(d->win) : 0; | ||
1060 | } | ||
1061 | |||
1058 | iInt2 rootSize_Window(const iWindow *d) { | 1062 | iInt2 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); | |||
60 | void setFreezeDraw_Window (iWindow *, iBool freezeDraw); | 60 | void setFreezeDraw_Window (iWindow *, iBool freezeDraw); |
61 | void setCursor_Window (iWindow *, int cursor); | 61 | void setCursor_Window (iWindow *, int cursor); |
62 | 62 | ||
63 | uint32_t id_Window (const iWindow *); | ||
63 | iInt2 rootSize_Window (const iWindow *); | 64 | iInt2 rootSize_Window (const iWindow *); |
64 | float uiScale_Window (const iWindow *); | 65 | float uiScale_Window (const iWindow *); |
65 | iInt2 coord_Window (const iWindow *, int x, int y); | 66 | iInt2 coord_Window (const iWindow *, int x, int y); |