diff options
Diffstat (limited to 'src/Dock.cpp')
-rw-r--r-- | src/Dock.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Dock.cpp b/src/Dock.cpp index 4c606df..8ad8b56 100644 --- a/src/Dock.cpp +++ b/src/Dock.cpp @@ -80,6 +80,15 @@ bool Dock::hasWindow(Window win) it2++; } + /* check keyboards */ + vector<DockKeyboard*>::const_iterator it3 = keyboards.begin(); + while(it3 != keyboards.end()) + { + if ((*it3)->hasWindow(win)) + return true; + it3++; + } + return false; } @@ -113,6 +122,17 @@ void Dock::handleExpose(XExposeEvent* ev) it2++; } + + vector<DockKeyboard*>::const_iterator it3 = keyboards.begin(); + while(it3 != keyboards.end()) + { + if ((*it3)->hasWindow(ev->window)) + { + (*it3)->handleExpose(ev); + break; + } + it3++; + } return; } @@ -175,6 +195,26 @@ void Dock::appendProcess(WMWindow* win) TRACE("append dock with %d, dpx %d\n", width, dp_x); } +void Dock::appendKeyboard(KeyboardDevice* k) +{ + x -= DOCK_BUTTON_WIDTH/2; + width += DOCK_BUTTON_WIDTH; + XMoveResizeWindow(x11->dpy, dock, x, y, width, height); + int dk_x = width - DOCK_BUTTON_WIDTH - DOCK_WIDTH_EXTENDED/2; + int dk_y = DOCK_HEIGHT_EXTENDED; + DockKeyboard* dk = new DockKeyboard(x11, k); + dk->initGUI(dock, dk_x, dk_y, DOCK_BUTTON_WIDTH, DOCK_BUTTON_HEIGHT); + dk->setup(); + keyboards.push_back(dk); + + XFreePixmap(x11->dpy, backbuff); + backbuff = XCreatePixmap(x11->dpy, dock, width, height, x11->depth); + repaint(); + + TRACE("append keyboard with %d, dkx %d\n", width, dk_x); +} + + /* * Removes a process from the dock. Usually after maximizing it again. */ |