diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:33 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:33 +0200 |
commit | f75ab6d2c11e8a8e18191b087564aedebbeb96c5 (patch) | |
tree | 2a046e11678e798f3f9c7f7af4f9ac205c8d2731 /ScreenManager.c | |
parent | 2004bbc3ef28ada3acca05f5d5fa9108121a6784 (diff) | |
download | debian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.tar.gz debian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.tar.bz2 debian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.zip |
Imported Upstream version 1.0.3upstream/1.0.3
Diffstat (limited to 'ScreenManager.c')
-rw-r--r-- | ScreenManager.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ScreenManager.c b/ScreenManager.c index 744ea2b..646ee2f 100644 --- a/ScreenManager.c +++ b/ScreenManager.c @@ -52,8 +52,8 @@ ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation ori this->y2 = y2; this->fuBar = NULL; this->orientation = orientation; - this->panels = Vector_new(PANEL_CLASS, owner, DEFAULT_SIZE, NULL); - this->fuBars = Vector_new(FUNCTIONBAR_CLASS, true, DEFAULT_SIZE, NULL); + this->panels = Vector_new(Class(Panel), owner, DEFAULT_SIZE); + this->fuBars = Vector_new(Class(FunctionBar), true, DEFAULT_SIZE); this->panelCount = 0; this->header = header; this->owner = owner; @@ -144,7 +144,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) { this->lastScan = now; } Header_draw(this->header); - ProcessList_rebuildPanel(this->header->pl, false, false, false, false, false, NULL); + ProcessList_rebuildPanel(this->header->pl, false, false, false, false, NULL); } for (int i = 0; i < panels; i++) { Panel* panel = (Panel*) Vector_get(this->panels, i); @@ -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); @@ -184,8 +185,8 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) { } } - if (panelFocus->eventHandler) { - HandlerResult result = panelFocus->eventHandler(panelFocus, ch); + if (Panel_eventHandlerFn(panelFocus)) { + HandlerResult result = Panel_eventHandler(panelFocus, ch); if (result == HANDLED) { continue; } else if (result == BREAK_LOOP) { |