summaryrefslogtreecommitdiffstats
path: root/ScreenManager.c
diff options
context:
space:
mode:
Diffstat (limited to 'ScreenManager.c')
-rw-r--r--ScreenManager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ScreenManager.c b/ScreenManager.c
index 9218909b..646ee2f0 100644
--- a/ScreenManager.c
+++ b/ScreenManager.c
@@ -173,7 +173,8 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
for (int i = 0; i < this->panelCount; i++) {
Panel* panel = (Panel*) Vector_get(this->panels, i);
if (mevent.x > panel->x && mevent.x <= panel->x+panel->w &&
- mevent.y > panel->y && mevent.y <= panel->y+panel->h) {
+ mevent.y > panel->y && mevent.y <= panel->y+panel->h &&
+ (this->allowFocusChange || panelFocus == panel) ) {
focus = i;
panelFocus = panel;
Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV - 1);