diff options
Diffstat (limited to 'src/ui/window.c')
-rw-r--r-- | src/ui/window.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ui/window.c b/src/ui/window.c index 0a97b97c..6f680cd4 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -682,6 +682,7 @@ iBool isFullscreen_MainWindow(const iMainWindow *d) { | |||
682 | } | 682 | } |
683 | 683 | ||
684 | iRoot *findRoot_Window(const iWindow *d, const iWidget *widget) { | 684 | iRoot *findRoot_Window(const iWindow *d, const iWidget *widget) { |
685 | |||
685 | while (widget->parent) { | 686 | while (widget->parent) { |
686 | widget = widget->parent; | 687 | widget = widget->parent; |
687 | } | 688 | } |
@@ -1023,7 +1024,7 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) { | |||
1023 | } | 1024 | } |
1024 | } | 1025 | } |
1025 | case SDL_RENDER_TARGETS_RESET: | 1026 | case SDL_RENDER_TARGETS_RESET: |
1026 | case SDL_RENDER_DEVICE_RESET: { | 1027 | case SDL_RENDER_DEVICE_RESET: { |
1027 | if (mw) { | 1028 | if (mw) { |
1028 | invalidate_MainWindow_(mw, iTrue /* force full reset */); | 1029 | invalidate_MainWindow_(mw, iTrue /* force full reset */); |
1029 | } | 1030 | } |
@@ -1109,7 +1110,7 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) { | |||
1109 | event.type == SDL_MOUSEBUTTONUP || event.type == SDL_MOUSEBUTTONDOWN) { | 1110 | event.type == SDL_MOUSEBUTTONUP || event.type == SDL_MOUSEBUTTONDOWN) { |
1110 | if (mouseGrab_Widget()) { | 1111 | if (mouseGrab_Widget()) { |
1111 | iWidget *grabbed = mouseGrab_Widget(); | 1112 | iWidget *grabbed = mouseGrab_Widget(); |
1112 | setCurrent_Root(findRoot_Window(d, grabbed)); | 1113 | setCurrent_Root(grabbed->root /* findRoot_Window(d, grabbed)*/); |
1113 | wasUsed = dispatchEvent_Widget(grabbed, &event); | 1114 | wasUsed = dispatchEvent_Widget(grabbed, &event); |
1114 | } | 1115 | } |
1115 | } | 1116 | } |
@@ -1200,13 +1201,11 @@ static uint32_t windowId_SDLEvent_(const SDL_Event *ev) { | |||
1200 | } | 1201 | } |
1201 | 1202 | ||
1202 | iBool dispatchEvent_Window(iWindow *d, const SDL_Event *ev) { | 1203 | iBool dispatchEvent_Window(iWindow *d, const SDL_Event *ev) { |
1203 | #if 0 | ||
1204 | /* For the right window? */ | 1204 | /* For the right window? */ |
1205 | const uint32_t evWin = windowId_SDLEvent_(ev); | 1205 | const uint32_t evWin = windowId_SDLEvent_(ev); |
1206 | if (evWin && evWin != id_Window(d)) { | 1206 | if (evWin && evWin != id_Window(d)) { |
1207 | return iFalse; /* Meant for a different window. */ | 1207 | return iFalse; /* Meant for a different window. */ |
1208 | } | 1208 | } |
1209 | #endif | ||
1210 | if (ev->type == SDL_MOUSEMOTION) { | 1209 | if (ev->type == SDL_MOUSEMOTION) { |
1211 | /* Hover widget may change. */ | 1210 | /* Hover widget may change. */ |
1212 | setHover_Widget(NULL); | 1211 | setHover_Widget(NULL); |
@@ -1591,6 +1590,7 @@ void setSplitMode_MainWindow(iMainWindow *d, int splitFlags) { | |||
1591 | } | 1590 | } |
1592 | iWindow *w = as_Window(d); | 1591 | iWindow *w = as_Window(d); |
1593 | iAssert(current_Root() == NULL); | 1592 | iAssert(current_Root() == NULL); |
1593 | setCurrent_Window(w); | ||
1594 | if (d->splitMode != splitMode) { | 1594 | if (d->splitMode != splitMode) { |
1595 | int oldCount = numRoots_Window(w); | 1595 | int oldCount = numRoots_Window(w); |
1596 | setFreezeDraw_MainWindow(d, iTrue); | 1596 | setFreezeDraw_MainWindow(d, iTrue); |
@@ -1619,8 +1619,8 @@ void setSplitMode_MainWindow(iMainWindow *d, int splitFlags) { | |||
1619 | /* The last child is the [+] button for adding a tab. */ | 1619 | /* The last child is the [+] button for adding a tab. */ |
1620 | moveTabButtonToEnd_Widget(findChild_Widget(docTabs, "newtab")); | 1620 | moveTabButtonToEnd_Widget(findChild_Widget(docTabs, "newtab")); |
1621 | setFlags_Widget(findWidget_Root("navbar.unsplit"), hidden_WidgetFlag, iTrue); | 1621 | setFlags_Widget(findWidget_Root("navbar.unsplit"), hidden_WidgetFlag, iTrue); |
1622 | iRelease(tabs); | ||
1623 | postCommandf_App("tabs.switch id:%s", cstr_String(id_Widget(constAs_Widget(curPage)))); | 1622 | postCommandf_App("tabs.switch id:%s", cstr_String(id_Widget(constAs_Widget(curPage)))); |
1623 | iRelease(tabs); | ||
1624 | } | 1624 | } |
1625 | else if (oldCount == 1 && splitMode) { | 1625 | else if (oldCount == 1 && splitMode) { |
1626 | /* Add a second root. */ | 1626 | /* Add a second root. */ |