ewmh compliance updates

This commit is contained in:
markt 2006-07-22 07:15:24 +00:00
parent a72fc5e002
commit 2d971ad48c
6 changed files with 49 additions and 6 deletions

View file

@ -1,5 +1,11 @@
(Format: Year/Month/Day)
Changes for 1.0rc3:
*06/07/22:
* Ewmh compliance updates: (Mark)
- implemented _NET_WM_MOVERESIZE_CANCEL (new in version 1.4.draft-1)
- move windows to last remaining workspace when a workspace is removed
- implemented _NET_REQUEST_FRAME_EXTENTS
Ewmh.cc/hh Workspace.cc/hh Screen.cc
*06/07/21:
* Stop using fixed values for num/caps/scroll lock, and ignore scroll lock
as a modifier (Mark)

View file

@ -30,6 +30,7 @@
#include "Layer.hh"
#include "WinClientUtil.hh"
#include "fluxbox.hh"
#include "FbWinFrameTheme.hh"
#include "FbTk/App.hh"
#include "FbTk/FbWindow.hh"
@ -61,7 +62,8 @@ enum EwmhMoveResizeDirection {
_NET_WM_MOVERESIZE_SIZE_LEFT = 7,
_NET_WM_MOVERESIZE_MOVE = 8, // movement only
_NET_WM_MOVERESIZE_SIZE_KEYBOARD = 9, // size via keyboard
_NET_WM_MOVERESIZE_MOVE_KEYBOARD = 10
_NET_WM_MOVERESIZE_MOVE_KEYBOARD = 10, // move via keyboard
_NET_WM_MOVERESIZE_CANCEL = 11 // cancel operation
};
Ewmh::Ewmh() {
@ -166,6 +168,7 @@ void Ewmh::initForScreen(BScreen &screen) {
m_net_moveresize_window,
m_net_workarea,
m_net_restack_window,
m_net_request_frame_extents,
m_net_wm_moveresize,
@ -311,6 +314,13 @@ void Ewmh::setupFrame(FluxboxWindow &win) {
}
}
/*
* NOT YET IMPLEMENTED:
* _NET_WM_WINDOW_TYPE_TOOLBAR
* _NET_WM_WINDOW_TYPE_MENU
* _NET_WM_WINDOW_TYPE_UTILITY
*/
setupState(win);
if (win.winClient().property(m_net_wm_desktop, 0, 1, False, XA_CARDINAL,
@ -872,6 +882,24 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
return true;
} else if (ce.message_type == m_net_request_frame_extents) {
if (!screen)
return true;
FbWinFrameTheme &theme = screen->winFrameTheme();
int title_h = theme.titleHeight() ||
theme.font().height() + 2*theme.bevelWidth() + 2;
title_h += theme.border().width();
int handle_h = theme.handleWidth() + theme.border().width();
int extents[4];
// our frames currently don't protrude from left/right
extents[0] = 0;
extents[1] = 0;
extents[2] = title_h;
extents[3] = handle_h;
XChangeProperty(FbTk::App::instance()->display(), ce.window,
m_net_frame_extents, XA_CARDINAL, 32, PropModeReplace,
(unsigned char *)extents, 4);
} else if (ce.message_type == m_net_wm_moveresize) {
if (winclient == 0 || winclient->fbwindow() == 0)
@ -903,6 +931,12 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
case _NET_WM_MOVERESIZE_MOVE_KEYBOARD:
winclient->fbwindow()->startMoving(ce.data.l[0], ce.data.l[1]);
break;
case _NET_WM_MOVERESIZE_CANCEL:
if (winclient->fbwindow()->isMoving())
winclient->fbwindow()->stopMoving(true);
if (winclient->fbwindow()->isResizing())
winclient->fbwindow()->stopResizing(true);
break;
default:
cerr << "Ewmh: Unknown move/resize direction: " << ce.data.l[2] << endl;
break;
@ -958,6 +992,8 @@ void Ewmh::createAtoms() {
m_net_close_window = XInternAtom(disp, "_NET_CLOSE_WINDOW", False);
m_net_moveresize_window = XInternAtom(disp, "_NET_MOVERESIZE_WINDOW", False);
m_net_restack_window = XInternAtom(disp, "_NET_RESTACK_WINDOW", False);
m_net_request_frame_extents = XInternAtom(disp,
"_NET_REQUEST_FRAME_EXTENTS", False);
m_net_wm_moveresize = XInternAtom(disp, "_NET_WM_MOVERESIZE", False);

View file

@ -99,7 +99,8 @@ private:
m_net_supporting_wm_check,
m_net_virtual_roots,
m_net_moveresize_window,
m_net_restack_window;
m_net_restack_window,
m_net_request_frame_extents;
// root window messages
Atom m_net_close_window, m_net_wm_moveresize;

View file

@ -1031,7 +1031,7 @@ int BScreen::removeLastWorkspace() {
if (m_current_workspace->workspaceID() == wkspc->workspaceID())
changeWorkspaceID(m_current_workspace->workspaceID() - 1);
wkspc->removeAll();
wkspc->removeAll(wkspc->workspaceID()-1);
//remove last workspace
m_workspaces_list.pop_back();

View file

@ -229,11 +229,11 @@ void Workspace::hideAll(bool interrupt_moving) {
}
void Workspace::removeAll() {
void Workspace::removeAll(unsigned int dest) {
Windows::iterator it = m_windowlist.begin();
Windows::const_iterator it_end = m_windowlist.end();
for (; it != it_end; ++it)
(*it)->iconify();
m_screen.sendToWorkspace(dest, *it, false);
}

View file

@ -58,7 +58,7 @@ public:
void showAll();
void hideAll(bool interrupt_moving);
/// Iconify all windows on this workspace
void removeAll();
void removeAll(unsigned int dest);
void reconfigure();
void shutdown();