all repos — fluxbox @ 85f45be7271252d86d583411780a4b139ee1aa75

custom fork of the fluxbox windowmanager

added support for _NET_WM_WINDOW_TYPE_DIALOG and _NET_FRAME_EXTENTS
fluxgen fluxgen
commit

85f45be7271252d86d583411780a4b139ee1aa75

parent

7d5f6e382b7f06913c421db4357e13841e1a9632

6 files changed, 63 insertions(+), 5 deletions(-)

jump to
M src/AtomHandler.hhsrc/AtomHandler.hh

@@ -53,7 +53,7 @@ virtual void updateWorkspace(FluxboxWindow &win) = 0;

virtual void updateState(FluxboxWindow &win) = 0; virtual void updateHints(FluxboxWindow &win) = 0; virtual void updateLayer(FluxboxWindow &win) = 0; - + virtual void updateFrameExtents(FluxboxWindow &win) { } virtual bool checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, WinClient * const winclient) = 0;
M src/Ewmh.ccsrc/Ewmh.cc

@@ -140,6 +140,7 @@ m_net_wm_window_type,

m_net_wm_window_type_dock, m_net_wm_window_type_desktop, m_net_wm_window_type_splash, + m_net_wm_window_type_dialog, m_net_wm_window_type_normal, // window actions

@@ -168,6 +169,7 @@ m_net_restack_window,

m_net_wm_moveresize, + m_net_frame_extents, // desktop properties m_net_wm_desktop,

@@ -259,7 +261,6 @@ if (atoms[l] == m_net_wm_window_type_dock) {

// we also assume it shouldn't be visible in any toolbar win.setFocusHidden(true); win.setIconHidden(true); - break; } else if (atoms[l] == m_net_wm_window_type_desktop) { /* * _NET_WM_WINDOW_TYPE_DESKTOP indicates a "false desktop" window

@@ -284,14 +285,28 @@ * window is a splash screen displayed as an application

* is starting up. */ win.setDecoration(FluxboxWindow::DECOR_NONE); + win.setFocusHidden(true); + win.setIconHidden(true); win.setMovable(false); } else if (atoms[l] == m_net_wm_window_type_normal) { // do nothing, this is ..normal.. + } else if (atoms[l] == m_net_wm_window_type_dialog) { + // dialog windows should not be tabable + win.setTabable(false); } } XFree(data); - } + } else { + // if _NET_WM_WINDOW_TYPE not set and this window + // has transient_for the type must be set to _NET_WM_WINDOW_TYPE_DIALOG + if ( win.winClient().isTransient() ) { + win.winClient(). + changeProperty(m_net_wm_window_type, + XA_ATOM, 32, PropModeReplace, + (unsigned char*)&m_net_wm_window_type_dialog, 1); + } + } setupState(win);

@@ -305,8 +320,11 @@ else

win.setWorkspace(desktop); XFree(data); - } else + } else { updateWorkspace(win); + } + + updateFrameExtents(win); }

@@ -940,6 +958,7 @@ m_net_wm_window_type = XInternAtom(disp, "_NET_WM_WINDOW_TYPE", False);

m_net_wm_window_type_dock = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DOCK", False); m_net_wm_window_type_desktop = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DESKTOP", False); m_net_wm_window_type_splash = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_SPLASH", False); + m_net_wm_window_type_dialog = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DIALOG", False); m_net_wm_window_type_normal = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_NORMAL", False); // state atom and the supported state atoms

@@ -975,6 +994,8 @@ m_net_wm_icon_geometry = XInternAtom(disp, "_NET_WM_ICON_GEOMETRY", False);

m_net_wm_icon = XInternAtom(disp, "_NET_WM_ICON", False); m_net_wm_pid = XInternAtom(disp, "_NET_WM_PID", False); m_net_wm_handled_icons = XInternAtom(disp, "_NET_WM_HANDLED_ICONS", False); + + m_net_frame_extents = XInternAtom(disp, "_NET_FRAME_EXTENTS", False); m_net_wm_ping = XInternAtom(disp, "_NET_WM_PING", False); utf8_string = XInternAtom(disp, "UTF8_STRING", False);

@@ -1220,6 +1241,23 @@ XFree(data);

} } +void Ewmh::updateFrameExtents(FluxboxWindow &win) { + int extents[4]; + extents[0] = win.frame().x(); + extents[1] = win.frame().x() + win.frame().width(); + extents[2] = win.frame().y(); + extents[3] = win.frame().y() + win.frame().height(); + + FluxboxWindow::ClientList::iterator it = win.clientList().begin(); + FluxboxWindow::ClientList::iterator it_end = win.clientList().end(); + for (; it != it_end; ++it) { + (*it)->changeProperty(m_net_frame_extents, + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *)extents, 4); + } +} + + Ewmh::WindowState::WindowState(int t_x, int t_y, unsigned int t_width, unsigned int t_height,

@@ -1255,3 +1293,4 @@ void Ewmh::saveState(FluxboxWindow &win, WindowState *state) {

m_savedstate[&win] = state; } +
M src/Ewmh.hhsrc/Ewmh.hh

@@ -64,6 +64,7 @@

void setFullscreen(FluxboxWindow &win, bool value); + void updateFrameExtents(FluxboxWindow &win); private: typedef struct WindowState {

@@ -82,6 +83,7 @@ void updateStrut(WinClient &winclient);

void updateActions(FluxboxWindow &win); void setupState(FluxboxWindow &win); + // root window properties Atom m_net_supported,

@@ -110,6 +112,7 @@ m_net_wm_window_type,

m_net_wm_window_type_dock, m_net_wm_window_type_desktop, m_net_wm_window_type_splash, + m_net_wm_window_type_dialog, m_net_wm_window_type_normal, // states

@@ -137,7 +140,9 @@ m_net_wm_action_change_desktop,

m_net_wm_action_close, m_net_wm_strut, m_net_wm_icon_geometry, m_net_wm_icon, m_net_wm_pid, - m_net_wm_handled_icons; + m_net_wm_handled_icons, + + m_net_frame_extents; // application protocols Atom m_net_wm_ping;
M src/Window.ccsrc/Window.cc

@@ -3900,6 +3900,10 @@

screen().updateNetizenConfigNotify(event); } } // end for + + if (send_to_netizens) { + Fluxbox::instance()->updateFrameExtents(*this); + } }
M src/fluxbox.ccsrc/fluxbox.cc

@@ -1847,3 +1847,11 @@ XGrabKeyboard(FbTk::App::instance()->display(),

screen.rootWindow().window(), True, GrabModeAsync, GrabModeAsync, CurrentTime); } + +void Fluxbox::updateFrameExtents(FluxboxWindow &win) { + AtomHandlerContainerIt it = m_atomhandler.begin(); + AtomHandlerContainerIt it_end = m_atomhandler.end(); + for (; it != it_end; ++it ) { + (*it).first->updateFrameExtents(win); + } +}
M src/fluxbox.hhsrc/fluxbox.hh

@@ -182,6 +182,8 @@ * @param screen the new screen

* @param old_screen the old screen if any, can be the same as new screen */ void updateFocusedWindow(BScreen *screen, BScreen *old_screen); + /// todo, remove this. just temporary + void updateFrameExtents(FluxboxWindow &win); void attachSignals(FluxboxWindow &win); void attachSignals(WinClient &winclient);