kranewm

An ICCCM & EWMH compliant X11 reparenting, dynamic window manager, written in C++
git clone git clone git://git.deurzen.net/kranewm.git
Log | Files | Refs | LICENSE

commit a8292ce30c7923ee22bc886efd115e7f7209c7eb
parent be63b03d4d6bb3f628a3055f1b67e765fdc5f3d5
Author: deurzen <m.deurzen@tum.de>
Date:   Sat, 27 Nov 2021 00:09:57 +0100

adds transparency support

Diffstat:
Msrc/core/model.cc | 45++++++---------------------------------------
Msrc/winsys/xdata/xconnection.cc | 21+++++++++++++++++++--
2 files changed, 25 insertions(+), 41 deletions(-)

diff --git a/src/core/model.cc b/src/core/model.cc @@ -619,10 +619,10 @@ Model::Model(Connection& conn) CALL_EXTERNAL(amixer -D pulse sset Capture toggle) }, { { Key::Return, { Main } }, - CALL_EXTERNAL(st) + CALL_EXTERNAL(alacritty) }, { { Key::Return, { Main, Shift } }, - CALL(spawn_external("st -n " + WM_NAME + ":cf")) + CALL(spawn_external("alacritty --class " + WM_NAME + ":cf,Alacritty")) }, { { Key::SemiColon, { Main } }, CALL_EXTERNAL(caja) @@ -642,6 +642,9 @@ Model::Model(Connection& conn) { { Key::Q, { Main, Ctrl } }, CALL_EXTERNAL(chromium) }, + { { Key::Apostrophe, { Main } }, + CALL_EXTERNAL(blueberry) + }, { { Key::P, { Main, Shift } }, CALL_EXTERNAL($HOME/bin/dmenupass) }, @@ -773,7 +776,7 @@ Model::Model(Connection& conn) }, { { MouseInput::MouseInputTarget::Global, Button::Left, { Main, Sec, Ctrl } }, [](Model& model, Client_ptr) { - model.spawn_external("st -n kranewm:cf"); + model.spawn_external("alacritty --class " + WM_NAME + ":cf,Alacritty"); return false; } }, @@ -2537,18 +2540,6 @@ Model::move_client_to_workspace(Index index, Client_ptr client) apply_stack(from); sync_focus(); - - if (client->leader) { - std::vector<Client_ptr>& members = m_leader_map.at(*client->leader); - - std::for_each( - members.begin(), - members.end(), - [this,index](Client_ptr member) { - move_client_to_workspace(index, member); - } - ); - } } @@ -2871,18 +2862,6 @@ Model::set_sticky_client(Toggle toggle, Client_ptr client) apply_layout(workspace); render_decoration(client); - if (client->leader) { - std::vector<Client_ptr>& members = m_leader_map.at(*client->leader); - - std::for_each( - members.begin(), - members.end(), - [this,toggle](Client_ptr member) { - set_sticky_client(toggle, member); - } - ); - } - return; } case Toggle::Off: @@ -2915,18 +2894,6 @@ Model::set_sticky_client(Toggle toggle, Client_ptr client) apply_layout(mp_workspace); render_decoration(client); - if (client->leader) { - std::vector<Client_ptr>& members = m_leader_map.at(*client->leader); - - std::for_each( - members.begin(), - members.end(), - [this,toggle](Client_ptr member) { - set_sticky_client(toggle, member); - } - ); - } - return; } case Toggle::Reverse: diff --git a/src/winsys/xdata/xconnection.cc b/src/winsys/xdata/xconnection.cc @@ -548,11 +548,28 @@ XConnection::cleanup() winsys::Window XConnection::create_frame(winsys::Region region) { - winsys::Window window = XCreateSimpleWindow( + long mask = CWBackPixel | CWBorderPixel; + XSetWindowAttributes wa; + + XVisualInfo vinfo; + if (XMatchVisualInfo(mp_dpy, DefaultScreen(mp_dpy), 32, TrueColor, &vinfo)) { + wa.colormap = XCreateColormap(mp_dpy, m_root, vinfo.visual, AllocNone); + mask |= CWColormap; + } + + wa.background_pixel = 0; + wa.border_pixel = 0; + + winsys::Window window = XCreateWindow( mp_dpy, m_root, region.pos.x, region.pos.y, region.dim.w, region.dim.h, - 0, 0, 0 + 0, + vinfo.depth, + InputOutput, + vinfo.visual, + mask, + &wa ); flush();