summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-05-20 14:54:41 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-05-20 14:54:41 +0300
commitb50e6343b962fe95150feb95cf0a5d3ed9c1bcb9 (patch)
treea256c627e8bf4c66a1127dd009e9d4d0f6861632 /src/ui/window.c
parent202e2a95e8f93d520377a03d0bc2c0c44cce95ab (diff)
Window: Allow all mouse clicks to change active split
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 87db2f3e..96a22fee 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -858,6 +858,19 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) {
858 const iInt2 pos = coord_Window(d, event.button.x, event.button.y); 858 const iInt2 pos = coord_Window(d, event.button.x, event.button.y);
859 event.button.x = pos.x; 859 event.button.x = pos.x;
860 event.button.y = pos.y; 860 event.button.y = pos.y;
861 if (event.type == SDL_MOUSEBUTTONDOWN) {
862 /* Button clicks will change keyroot. */
863 if (numRoots_Window(d) > 1) {
864 const iInt2 click = init_I2(event.button.x, event.button.y);
865 iForIndices(i, d->roots) {
866 iRoot *root = d->roots[i];
867 if (root != d->keyRoot && contains_Rect(rect_Root(root), click)) {
868 setKeyRoot_Window(d, root);
869 break;
870 }
871 }
872 }
873 }
861 } 874 }
862 const iWidget *oldHover = d->hover; 875 const iWidget *oldHover = d->hover;
863 iBool wasUsed = iFalse; 876 iBool wasUsed = iFalse;
@@ -889,7 +902,9 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) {
889 wasUsed = dispatchEvent_Window(d, &paste); 902 wasUsed = dispatchEvent_Window(d, &paste);
890 } 903 }
891 if (event.type == SDL_MOUSEBUTTONDOWN && event.button.button == SDL_BUTTON_RIGHT) { 904 if (event.type == SDL_MOUSEBUTTONDOWN && event.button.button == SDL_BUTTON_RIGHT) {
892 postContextClick_Window(d, &event.button); 905 if (postContextClick_Window(d, &event.button)) {
906 wasUsed = iTrue;
907 }
893 } 908 }
894 } 909 }
895 if (isMetricsChange_UserEvent(&event)) { 910 if (isMetricsChange_UserEvent(&event)) {