Skip to content

Commit

Permalink
Support changing the Dock container layer while running.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Jul 14, 2024
1 parent 33c721c commit 8b30a83
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/wmdock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <X11/Xatom.h>

const char DockApp::propertyName[] = "_ICEWM_DOCKAPPS";
extern bool limitByDockLayer;

DockApp::DockApp():
YWindow(nullptr, None,
Expand Down Expand Up @@ -344,7 +345,6 @@ void DockApp::adapt() {
timer = null;

if (wold != int(visible()) * width() && layered == WinLayerDock) {
extern bool limitByDockLayer;
if (limitByDockLayer)
manager->requestWorkAreaUpdate();
}
Expand Down Expand Up @@ -581,3 +581,19 @@ void DockApp::handleEndDrag(const XButtonEvent& down, const XButtonEvent& up) {
}
}

void DockApp::handleClientMessage(const XClientMessageEvent& message) {
if (message.message_type == _XA_WIN_LAYER) {
long layer = message.data.l[0];
if (validLayer(layer) && layer != layered) {
bool work = (layer == WinLayerDock || layered == WinLayerDock);
layered = int(layer);
setProperty(_XA_WIN_LAYER, XA_CARDINAL, layer);
if (visible() && docks.nonempty()) {
manager->restackWindows();
}
if (work && limitByDockLayer)
manager->requestWorkAreaUpdate();
}
}
}

3 changes: 3 additions & 0 deletions src/wmdock.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class DockApp:
void handleDrag(const XButtonEvent& down, const XMotionEvent& move) override;
void handleEndDrag(const XButtonEvent& down, const XButtonEvent& up) override;
void handlePopDown(YPopupWindow *popup) override;
void handleClientMessage(const XClientMessageEvent &message) override;
void handleClose() override {}
void gotFocus() override {}
bool handleTimer(YTimer* timer) override;
lazy<YTimer> timer;
lazy<YMenu> menu;
Expand Down

0 comments on commit 8b30a83

Please sign in to comment.