From d91bf8ffdb0be02f95a4c93fc57e7f213311b9d3 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 22 Jul 2007 11:18:38 +0000 Subject: remove a bunch of ancient blackbox features that blackbox doesn't even support anymore --- src/FbAtoms.cc | 29 -------- src/FbAtoms.hh | 41 +----------- src/FbCommands.cc | 2 +- src/Makefile.am | 1 - src/Netizen.cc | 112 ------------------------------- src/Netizen.hh | 58 ---------------- src/Screen.cc | 106 ----------------------------- src/Screen.hh | 17 ----- src/Slit.cc | 7 -- src/WinClient.cc | 35 ---------- src/WinClient.hh | 4 -- src/Window.cc | 196 ++---------------------------------------------------- src/Window.hh | 9 +-- src/Workspace.cc | 9 --- src/fluxbox.cc | 39 ----------- 15 files changed, 9 insertions(+), 656 deletions(-) delete mode 100644 src/Netizen.cc delete mode 100644 src/Netizen.hh diff --git a/src/FbAtoms.cc b/src/FbAtoms.cc index e6b5e51..ccbf41c 100644 --- a/src/FbAtoms.cc +++ b/src/FbAtoms.cc @@ -60,35 +60,6 @@ void FbAtoms::initAtoms() { xa_wm_take_focus = XInternAtom(display, "WM_TAKE_FOCUS", False); motif_wm_hints = XInternAtom(display, "_MOTIF_WM_HINTS", False); - blackbox_hints = XInternAtom(display, "_BLACKBOX_HINTS", False); blackbox_attributes = XInternAtom(display, "_BLACKBOX_ATTRIBUTES", False); - blackbox_change_attributes = - XInternAtom(display, "_BLACKBOX_CHANGE_ATTRIBUTES", False); - - blackbox_structure_messages = - XInternAtom(display, "_BLACKBOX_STRUCTURE_MESSAGES", False); - blackbox_notify_startup = - XInternAtom(display, "_BLACKBOX_NOTIFY_STARTUP", False); - blackbox_notify_window_add = - XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_ADD", False); - blackbox_notify_window_del = - XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_DEL", False); - blackbox_notify_current_workspace = - XInternAtom(display, "_BLACKBOX_NOTIFY_CURRENT_WORKSPACE", False); - blackbox_notify_workspace_count = - XInternAtom(display, "_BLACKBOX_NOTIFY_WORKSPACE_COUNT", False); - blackbox_notify_window_focus = - XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_FOCUS", False); - blackbox_notify_window_raise = - XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_RAISE", False); - blackbox_notify_window_lower = - XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_LOWER", False); - - blackbox_change_workspace = - XInternAtom(display, "_BLACKBOX_CHANGE_WORKSPACE", False); - blackbox_change_window_focus = - XInternAtom(display, "_BLACKBOX_CHANGE_WINDOW_FOCUS", False); - blackbox_cycle_window_focus = - XInternAtom(display, "_BLACKBOX_CYCLE_WINDOW_FOCUS", False); } diff --git a/src/FbAtoms.hh b/src/FbAtoms.hh index 5e8e75f..0f2e147 100644 --- a/src/FbAtoms.hh +++ b/src/FbAtoms.hh @@ -40,57 +40,18 @@ public: inline Atom getWMProtocolsAtom() const { return xa_wm_protocols; } inline Atom getWMTakeFocusAtom() const { return xa_wm_take_focus; } - // this atom is for normal app->WM hints about decorations, stacking, - // starting workspace etc... - inline Atom getFluxboxHintsAtom() const { return blackbox_hints;} inline Atom getMWMHintsAtom() const { return motif_wm_hints; } // these atoms are for normal app->WM interaction beyond the scope of the // ICCCM... inline Atom getFluxboxAttributesAtom() const { return blackbox_attributes; } - inline Atom getFluxboxChangeAttributesAtom() const { return blackbox_change_attributes; } - - // these atoms are for window->WM interaction, with more control and - // information on window "structure"... common examples are - // notifying apps when windows are raised/lowered... when the user changes - // workspaces... i.e. "pager talk" - inline Atom getFluxboxStructureMessagesAtom() const{ return blackbox_structure_messages; } - - // *Notify* portions of the NETStructureMessages protocol - inline Atom getFluxboxNotifyStartupAtom() const { return blackbox_notify_startup; } - inline Atom getFluxboxNotifyWindowAddAtom() const { return blackbox_notify_window_add; } - inline Atom getFluxboxNotifyWindowDelAtom() const { return blackbox_notify_window_del; } - inline Atom getFluxboxNotifyWindowFocusAtom() const { return blackbox_notify_window_focus; } - inline Atom getFluxboxNotifyCurrentWorkspaceAtom() const { return blackbox_notify_current_workspace; } - inline Atom getFluxboxNotifyWorkspaceCountAtom() const { return blackbox_notify_workspace_count; } - inline Atom getFluxboxNotifyWindowRaiseAtom() const { return blackbox_notify_window_raise; } - inline Atom getFluxboxNotifyWindowLowerAtom() const { return blackbox_notify_window_lower; } - - // atoms to change that request changes to the desktop environment during - // runtime... these messages can be sent by any client... as the sending - // client window id is not included in the ClientMessage event... - inline Atom getFluxboxChangeWorkspaceAtom() const { return blackbox_change_workspace; } - inline Atom getFluxboxChangeWindowFocusAtom() const { return blackbox_change_window_focus; } - inline Atom getFluxboxCycleWindowFocusAtom() const { return blackbox_cycle_window_focus; } private: void initAtoms(); // NETAttributes - Atom blackbox_attributes, blackbox_change_attributes, blackbox_hints; - + Atom blackbox_attributes; Atom motif_wm_hints; - // NETStructureMessages - Atom blackbox_structure_messages, blackbox_notify_startup, - blackbox_notify_window_add, blackbox_notify_window_del, - blackbox_notify_window_focus, blackbox_notify_current_workspace, - blackbox_notify_workspace_count, blackbox_notify_window_raise, - blackbox_notify_window_lower; - - // message_types for client -> wm messages - Atom blackbox_change_workspace, blackbox_change_window_focus, - blackbox_cycle_window_focus; - Atom xa_wm_protocols, xa_wm_state, xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state; diff --git a/src/FbCommands.cc b/src/FbCommands.cc index b6d8ebc..2527ccf 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -153,7 +153,7 @@ int ExecuteCmd::run() { // get shell path from the environment // this process exits immediately, so we don't have to worry about memleaks - char *shell = getenv("SHELL"); + const char *shell = getenv("SHELL"); if (!shell) shell = "/bin/sh"; diff --git a/src/Makefile.am b/src/Makefile.am index f66ddc9..f82a206 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -101,7 +101,6 @@ fluxbox_SOURCES = AtomHandler.hh ArrowButton.hh ArrowButton.cc \ FbWinFrameTheme.hh FbWinFrameTheme.cc \ fluxbox.cc fluxbox.hh \ Keys.cc Keys.hh main.cc \ - Netizen.cc Netizen.hh \ RootTheme.hh RootTheme.cc \ FbRootWindow.hh FbRootWindow.cc \ Screen.cc Screen.hh ScreenResources.cc \ diff --git a/src/Netizen.cc b/src/Netizen.cc deleted file mode 100644 index c220a83..0000000 --- a/src/Netizen.cc +++ /dev/null @@ -1,112 +0,0 @@ -// Netizen.cc for Fluxbox -// Copyright (c) 2001 - 2003 Henrik Kinnunen (fluxgen at fluxbox dot org) -// -// Netizen.cc for Blackbox - An X11 Window Manager -// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#include "Netizen.hh" - -#include "Screen.hh" -#include "FbAtoms.hh" - -#include "FbTk/App.hh" - -Netizen::Netizen(const BScreen &scr, Window win): - m_screen(scr), - m_display(FbTk::App::instance()->display()), - m_window(win) { - - event.type = ClientMessage; - event.xclient.message_type = FbAtoms::instance()->getFluxboxStructureMessagesAtom(); - event.xclient.display = m_display; - event.xclient.window = window(); - event.xclient.format = 32; - event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyStartupAtom(); - event.xclient.data.l[1] = event.xclient.data.l[2] = - event.xclient.data.l[3] = event.xclient.data.l[4] = 0l; - - XSendEvent(m_display, window(), False, NoEventMask, &event); -} - - -void Netizen::sendWorkspaceCount() { - - event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWorkspaceCountAtom(); - event.xclient.data.l[1] = m_screen.numberOfWorkspaces(); - - XSendEvent(m_display, window(), False, NoEventMask, &event); -} - - -void Netizen::sendCurrentWorkspace() { - - event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyCurrentWorkspaceAtom(); - event.xclient.data.l[1] = m_screen.currentWorkspaceID(); - - XSendEvent(m_display, window(), False, NoEventMask, &event); -} - - -void Netizen::sendWindowFocus(Window w) { - event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowFocusAtom(); - event.xclient.data.l[1] = w; - - XSendEvent(m_display, window(), False, NoEventMask, &event); -} - - -void Netizen::sendWindowAdd(Window w, unsigned long wkspc) { - event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowAddAtom(); - event.xclient.data.l[1] = w; - event.xclient.data.l[2] = wkspc; - - XSendEvent(m_display, window(), False, NoEventMask, &event); - - event.xclient.data.l[2] = 0l; -} - - -void Netizen::sendWindowDel(Window w) { - event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowDelAtom(); - event.xclient.data.l[1] = w; - - XSendEvent(m_display, window(), False, NoEventMask, &event); -} - - -void Netizen::sendWindowRaise(Window w) { - event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowRaiseAtom(); - event.xclient.data.l[1] = w; - - XSendEvent(m_display, window(), False, NoEventMask, &event); -} - - -void Netizen::sendWindowLower(Window w) { - event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowLowerAtom(); - event.xclient.data.l[1] = w; - - XSendEvent(m_display, window(), False, NoEventMask, &event); -} - -void Netizen::sendConfigNotify(XEvent &ev) { - XSendEvent(m_display, window(), False, StructureNotifyMask, &ev); -} diff --git a/src/Netizen.hh b/src/Netizen.hh deleted file mode 100644 index 334a065..0000000 --- a/src/Netizen.hh +++ /dev/null @@ -1,58 +0,0 @@ -// Netizen.hh for Fluxbox -// Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen at fluxbox dot org) -// -// Netizen.hh for Blackbox - An X11 Window Manager -// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#ifndef NETIZEN_HH -#define NETIZEN_HH - -#include - -class BScreen; - -class Netizen { -public: - Netizen(const BScreen &scr, Window w); - - inline Window window() const { return m_window; } - - void sendWorkspaceCount(); - void sendCurrentWorkspace(); - - void sendWindowFocus(Window w); - void sendWindowAdd(Window w, unsigned long wkspc); - void sendWindowDel(Window w); - void sendWindowRaise(Window w); - void sendWindowLower(Window w); - - void sendConfigNotify(XEvent &xe); -private: - const BScreen &m_screen; - Display *m_display; ///< display connection - Window m_window; - XEvent event; - -}; - - -#endif // _NETIZEN_HH_ - diff --git a/src/Screen.cc b/src/Screen.cc index a87a842..e89db09 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -31,7 +31,6 @@ #include "Keys.hh" #include "Window.hh" #include "Workspace.hh" -#include "Netizen.hh" #include "Layer.hh" #include "FocusControl.hh" @@ -520,7 +519,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm, } changeWorkspaceID(first_desktop); - updateNetizenWorkspaceCount(); // we need to load win frame theme before we create any fluxbox window // and after we've load the resources @@ -595,7 +593,6 @@ BScreen::~BScreen() { removeWorkspaceNames(); using namespace STLUtil; destroyAndClear(m_workspaces_list); - destroyAndClear(m_netizen_list); destroyAndClear(m_managed_resources); //why not destroyAndClear(m_icon_list); ? @@ -1204,8 +1201,6 @@ int BScreen::addWorkspace() { saveWorkspaces(m_workspaces_list.size()); - updateNetizenWorkspaceCount(); - return m_workspaces_list.size(); } @@ -1233,7 +1228,6 @@ int BScreen::removeLastWorkspace() { //remove last workspace m_workspaces_list.pop_back(); - updateNetizenWorkspaceCount(); saveWorkspaces(m_workspaces_list.size()); // must be deleted after we send notify!! // so we dont get bad pointers somewhere @@ -1300,7 +1294,6 @@ void BScreen::changeWorkspaceID(unsigned int id) { } else FocusControl::revertFocus(*this); - updateNetizenCurrentWorkspace(); FbTk::App::instance()->sync(false); } @@ -1348,105 +1341,6 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS } -void BScreen::addNetizen(Window win) { - Netizen *net = new Netizen(*this, win); - m_netizen_list.push_back(net); - - net->sendWorkspaceCount(); - net->sendCurrentWorkspace(); - - // send all windows to netizen - Workspaces::iterator it = m_workspaces_list.begin(); - Workspaces::iterator it_end = m_workspaces_list.end(); - for (; it != it_end; ++it) { - Workspace::Windows::iterator win_it = (*it)->windowList().begin(); - Workspace::Windows::iterator win_it_end = (*it)->windowList().end(); - for (; win_it != win_it_end; ++win_it) { - net->sendWindowAdd((*win_it)->clientWindow(), - (*it)->workspaceID()); - } - } - - Window f = ((FocusControl::focusedWindow()) ? - FocusControl::focusedWindow()->window() : None); - net->sendWindowFocus(f); -} - -void BScreen::removeNetizen(Window w) { - Netizens::iterator it = m_netizen_list.begin(); - Netizens::iterator it_end = m_netizen_list.end(); - for (; it != it_end; ++it) { - if ((*it)->window() == w) { - Netizen *n = *it; - delete n; - m_netizen_list.erase(it); - break; - } - } -} - - -void BScreen::updateNetizenCurrentWorkspace() { - m_currentworkspace_sig.notify(); - for_each(m_netizen_list.begin(), - m_netizen_list.end(), - mem_fun(&Netizen::sendCurrentWorkspace)); -} - - -void BScreen::updateNetizenWorkspaceCount() { - for_each(m_netizen_list.begin(), - m_netizen_list.end(), - mem_fun(&Netizen::sendWorkspaceCount)); - m_workspacecount_sig.notify(); -} - - -void BScreen::updateNetizenWindowFocus() { - Window f = ((FocusControl::focusedWindow()) ? - FocusControl::focusedWindow()->window() : None); - for_each(m_netizen_list.begin(), - m_netizen_list.end(), - bind2nd(mem_fun(&Netizen::sendWindowFocus), f)); -} - - -void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) { - Netizens::iterator it = m_netizen_list.begin(); - Netizens::iterator it_end = m_netizen_list.end(); - for (; it != it_end; ++it) { - (*it)->sendWindowAdd(w, p); - } -} - - -void BScreen::updateNetizenWindowDel(Window w) { - for_each(m_netizen_list.begin(), - m_netizen_list.end(), - bind2nd(mem_fun(&Netizen::sendWindowDel), w)); -} - - -void BScreen::updateNetizenWindowRaise(Window w) { - for_each(m_netizen_list.begin(), - m_netizen_list.end(), - bind2nd(mem_fun(&Netizen::sendWindowRaise), w)); -} - - -void BScreen::updateNetizenWindowLower(Window w) { - for_each(m_netizen_list.begin(), - m_netizen_list.end(), - bind2nd(mem_fun(&Netizen::sendWindowLower), w)); -} - -void BScreen::updateNetizenConfigNotify(XEvent &e) { - Netizens::iterator it = m_netizen_list.begin(); - Netizens::iterator it_end = m_netizen_list.end(); - for (; it != it_end; ++it) - (*it)->sendConfigNotify(e); -} - bool BScreen::isKdeDockapp(Window client) const { //Check and see if client is KDE dock applet. bool iskdedockapp = false; diff --git a/src/Screen.hh b/src/Screen.hh index 91dcf15..a094bac 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -58,7 +58,6 @@ class ClientPattern; class Focusable; class FluxboxWindow; -class Netizen; class FbWinFrameTheme; class RootTheme; class WinButtonTheme; @@ -363,10 +362,6 @@ public: void updateWorkspaceNamesAtom(); /// add a workspace name to the end of the workspace name list void addWorkspaceName(const char *name); - /// add a Netizen window - void addNetizen(Window win); - /// remove a netizen - void removeNetizen(Window win); /// add a window to the icon list void addIcon(FluxboxWindow *win); /// remove a window from the icon list @@ -465,16 +460,6 @@ public: WinClient *findGroupLeft(WinClient &winclient); WinClient *findGroupRight(WinClient &winclient); - // notify netizens - void updateNetizenCurrentWorkspace(); - void updateNetizenWorkspaceCount(); - void updateNetizenWindowFocus(); - void updateNetizenWindowAdd(Window, unsigned long); - void updateNetizenWindowDel(Window); - void updateNetizenConfigNotify(XEvent &ev); - void updateNetizenWindowRaise(Window); - void updateNetizenWindowLower(Window); - /// create window frame for client window and attach it FluxboxWindow *createWindow(Window clientwin); /// creates a window frame for a winclient. The client is attached to the window @@ -544,12 +529,10 @@ private: ExtraMenus m_extramenus; typedef std::list Rootmenus; - typedef std::list Netizens; typedef std::list > Configmenus; Rootmenus m_rootmenu_list; - Netizens m_netizen_list; Configmenus m_configmenu_list; Icons m_icon_list; diff --git a/src/Slit.cc b/src/Slit.cc index a8e95a0..c0ff1ac 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -501,11 +501,6 @@ void Slit::addClient(Window w) { if (XGetWMProtocols(disp, w, &proto, &num_return)) { - for (int i = 0; i < num_return; ++i) { - if (proto[i] == fbatoms->getFluxboxStructureMessagesAtom()) - screen().addNetizen(w); - } - XFree((void *) proto); #ifdef DEBUG } else { @@ -588,8 +583,6 @@ void Slit::removeClient(SlitClient *client, bool remap, bool destroy) { else // Clear the window info, but keep around to help future sorting? client->initialize(); - screen().removeNetizen(client->window()); - if (remap && client->window() != 0) { Display *disp = FbTk::App::instance()->display(); diff --git a/src/WinClient.cc b/src/WinClient.cc index a9d5865..d75d6eb 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc @@ -84,12 +84,10 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin): m_win_gravity(0), m_title_override(false), m_icon_title_override(false), - m_blackbox_hint(0), m_mwm_hint(0), m_focus_mode(F_PASSIVE), m_strut(0) { updateWMProtocols(); - updateBlackboxHints(); updateMWMHints(); updateWMHints(); updateWMNormalHints(); @@ -156,8 +154,6 @@ WinClient::~WinClient() { s_transient_wait.erase(window()); - screen().removeNetizen(window()); - if (window_group != 0) { fluxbox->removeGroupSearch(window_group); window_group = 0; @@ -166,9 +162,6 @@ WinClient::~WinClient() { if (m_mwm_hint != 0) XFree(m_mwm_hint); - if (m_blackbox_hint != 0) - XFree(m_blackbox_hint); - if (window()) fluxbox->removeWindowSearch(window()); } @@ -431,31 +424,6 @@ void WinClient::setFluxboxWindow(FluxboxWindow *win) { m_fbwin = win; } -void WinClient::updateBlackboxHints() { - int format; - Atom atom_return; - unsigned long num, len; - FbAtoms *atoms = FbAtoms::instance(); - - if (m_blackbox_hint) { - XFree(m_blackbox_hint); - m_blackbox_hint = 0; - } - - if (property(atoms->getFluxboxHintsAtom(), 0, - PropBlackboxHintsElements, False, - atoms->getFluxboxHintsAtom(), &atom_return, - &format, &num, &len, - (unsigned char **) &m_blackbox_hint) && - m_blackbox_hint) { - - if (num != (unsigned)PropBlackboxHintsElements) { - XFree(m_blackbox_hint); - m_blackbox_hint = 0; - } - } -} - void WinClient::updateMWMHints() { int format; Atom atom_return; @@ -752,14 +720,11 @@ void WinClient::updateWMProtocols() { // defaults send_focus_message = false; send_close_message = false; - // could be added to netizens twice... for (int i = 0; i < num_return; ++i) { if (proto[i] == fbatoms->getWMDeleteAtom()) send_close_message = true; else if (proto[i] == fbatoms->getWMTakeFocusAtom()) send_focus_message = true; - else if (proto[i] == fbatoms->getFluxboxStructureMessagesAtom()) - screen().addNetizen(window()); } XFree(proto); diff --git a/src/WinClient.hh b/src/WinClient.hh index 9c29e78..4a5cf27 100644 --- a/src/WinClient.hh +++ b/src/WinClient.hh @@ -70,7 +70,6 @@ public: /// updates transient window information void updateTransientInfo(); - void updateBlackboxHints(); void updateMWMHints(); void updateWMHints(); void updateWMNormalHints(); @@ -129,13 +128,11 @@ public: Window getGroupLeftWindow() const; inline int getFocusMode() const { return m_focus_mode; } - inline const FluxboxWindow::BlackboxHints *getBlackboxHint() const { return m_blackbox_hint; } inline const MwmHints *getMwmHint() const { return m_mwm_hint; } inline unsigned int maxWidth() const { return max_width; } inline unsigned int maxHeight() const { return max_height; } - static const int PropBlackboxHintsElements = 5; static const int PropMwmHintsElements = 3; /** @@ -177,7 +174,6 @@ private: std::string m_icon_title; bool m_title_override, m_icon_title_override; - FluxboxWindow::BlackboxHints *m_blackbox_hint; MwmHints *m_mwm_hint; int m_focus_mode; diff --git a/src/Window.cc b/src/Window.cc index 9ec92c4..aaa2348 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -147,7 +147,6 @@ void raiseFluxboxWindow(FluxboxWindow &win) { win.screen().layerManager().lock(); if (!win.isIconic()) { - win.screen().updateNetizenWindowRaise(win.clientWindow()); win.layerItem().raise(); } @@ -182,7 +181,6 @@ void lowerFluxboxWindow(FluxboxWindow &win) { win.screen().layerManager().lock(); if (!win.isIconic()) { - win.screen().updateNetizenWindowLower(win.clientWindow()); win.layerItem().lower(); } @@ -205,7 +203,6 @@ void tempRaiseFluxboxWindow(FluxboxWindow &win) { win.oplock = true; if (!win.isIconic()) { - // don't update netizen, as it is only temporary win.layerItem().tempRaise(); } @@ -402,10 +399,7 @@ void FluxboxWindow::init() { functions.resize = functions.move = functions.iconify = functions.maximize = functions.close = functions.tabable = true; - if (m_client->getBlackboxHint() != 0) - updateBlackboxHintsFromClient(*m_client); - else - updateMWMHintsFromClient(*m_client); + updateMWMHintsFromClient(*m_client); //!! // fetch client size and placement @@ -1212,43 +1206,6 @@ void FluxboxWindow::updateFunctions() { setupWindow(); } -void FluxboxWindow::updateBlackboxHintsFromClient(const WinClient &client) { - const FluxboxWindow::BlackboxHints *hint = client.getBlackboxHint(); - if (!hint) return; - - if (hint->flags & ATTRIB_SHADED) - shaded = (hint->attrib & ATTRIB_SHADED); - - if (hint->flags & ATTRIB_HIDDEN) - iconic = (hint->attrib & ATTRIB_HIDDEN); - - if ((hint->flags & ATTRIB_MAXHORIZ) && - (hint->flags & ATTRIB_MAXVERT)) - maximized = ((hint->attrib & - (ATTRIB_MAXHORIZ | - ATTRIB_MAXVERT)) ? MAX_FULL : MAX_NONE); - else if (hint->flags & ATTRIB_MAXVERT) - maximized = ((hint->attrib & - ATTRIB_MAXVERT) ? MAX_VERT : MAX_NONE); - else if (hint->flags & ATTRIB_MAXHORIZ) - maximized = ((hint->attrib & - ATTRIB_MAXHORIZ) ? MAX_HORZ : MAX_NONE); - - if (hint->flags & ATTRIB_OMNIPRESENT) - stuck = (hint->attrib & ATTRIB_OMNIPRESENT); - - if (hint->flags & ATTRIB_WORKSPACE) - m_workspace_number = hint->workspace; - - if (hint->flags & ATTRIB_STACK) - m_workspace_number = hint->stack; - - if (hint->flags & ATTRIB_DECORATION) { - m_old_decoration = static_cast(hint->decoration); - setDecoration(m_old_decoration, false); - } -} - void FluxboxWindow::move(int x, int y) { moveResize(x, y, frame().width(), frame().height()); } @@ -1503,9 +1460,6 @@ void FluxboxWindow::iconify() { if (isIconic()) // no need to iconify if we're already return; - m_blackbox_attrib.flags |= ATTRIB_HIDDEN; - m_blackbox_attrib.attrib |= ATTRIB_HIDDEN; - iconic = true; hide(true); @@ -1551,7 +1505,6 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) { bool was_iconic = iconic; - m_blackbox_attrib.flags &= ~ATTRIB_HIDDEN; iconic = false; if (reassoc && !m_client->transients.empty()) { @@ -1786,9 +1739,6 @@ void FluxboxWindow::setWorkspace(int n) { m_workspace_number = n; - m_blackbox_attrib.flags |= ATTRIB_WORKSPACE; - m_blackbox_attrib.workspace = m_workspace_number; - // notify workspace change if (m_initialized && !stuck && old_wkspc != m_workspace_number) { #ifdef DEBUG @@ -1825,8 +1775,6 @@ void FluxboxWindow::shade() { frame().shade(); shaded = !shaded; - m_blackbox_attrib.flags ^= ATTRIB_SHADED; - m_blackbox_attrib.attrib ^= ATTRIB_SHADED; // TODO: this should set IconicState, but then we can't focus the window } @@ -1847,8 +1795,6 @@ void FluxboxWindow::shadeOff() { void FluxboxWindow::stick() { - m_blackbox_attrib.flags ^= ATTRIB_OMNIPRESENT; - m_blackbox_attrib.attrib ^= ATTRIB_OMNIPRESENT; stuck = !stuck; if (m_initialized) { @@ -1959,12 +1905,6 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) { FluxboxWindow *win = client->fbwindow(); if (!win) return; - if (!win->isIconic()) { - if (layernum > m_layernum) - screen().updateNetizenWindowLower(client->window()); - else - screen().updateNetizenWindowRaise(client->window()); - } win->layerItem().moveToLayer(layernum); // remember number just in case a transient happens to revisit this window layernum = win->layerItem().getLayerNum(); @@ -1980,7 +1920,6 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) { for (; it != it_end; ++it) { FluxboxWindow *fbwin = (*it)->fbwindow(); if (fbwin && !fbwin->isIconic()) { - screen().updateNetizenWindowRaise((*it)->window()); fbwin->layerItem().moveToLayer(layernum); fbwin->setLayerNum(layernum); } @@ -2185,23 +2124,6 @@ void FluxboxWindow::restoreAttributes() { } else return; - if (m_blackbox_attrib.flags & ATTRIB_SHADED && - m_blackbox_attrib.attrib & ATTRIB_SHADED) - shaded = true; - - if (m_blackbox_attrib.flags & ATTRIB_HIDDEN && - m_blackbox_attrib.attrib & ATTRIB_HIDDEN) { - iconic = true; - } - - if (( m_blackbox_attrib.workspace != screen().currentWorkspaceID()) && - ( m_blackbox_attrib.workspace < screen().numberOfWorkspaces())) - m_workspace_number = m_blackbox_attrib.workspace; - - if (m_blackbox_attrib.flags & ATTRIB_OMNIPRESENT && - m_blackbox_attrib.attrib & ATTRIB_OMNIPRESENT) - stuck = true; - if (m_blackbox_attrib.flags & ATTRIB_STACK) { //!! TODO check value? m_layernum = m_blackbox_attrib.stack; @@ -2209,21 +2131,10 @@ void FluxboxWindow::restoreAttributes() { if ((m_blackbox_attrib.flags & ATTRIB_MAXHORIZ) || (m_blackbox_attrib.flags & ATTRIB_MAXVERT)) { - int x = m_blackbox_attrib.premax_x, y = m_blackbox_attrib.premax_y; - unsigned int w = m_blackbox_attrib.premax_w, h = m_blackbox_attrib.premax_h; - maximized = MAX_NONE; - if ((m_blackbox_attrib.flags & ATTRIB_MAXHORIZ) && - (m_blackbox_attrib.flags & ATTRIB_MAXVERT)) - maximized = MAX_FULL; - else if (m_blackbox_attrib.flags & ATTRIB_MAXVERT) - maximized = MAX_VERT; - else if (m_blackbox_attrib.flags & ATTRIB_MAXHORIZ) - maximized = MAX_HORZ; - - m_blackbox_attrib.premax_x = x; - m_blackbox_attrib.premax_y = y; - m_blackbox_attrib.premax_w = w; - m_blackbox_attrib.premax_h = h; + m_blackbox_attrib.premax_x = m_blackbox_attrib.premax_x; + m_blackbox_attrib.premax_y = m_blackbox_attrib.premax_y; + m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_w; + m_blackbox_attrib.premax_h = m_blackbox_attrib.premax_h; } } @@ -2535,14 +2446,6 @@ void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) { updateMWMHintsFromClient(client); updateRememberStateFromClient(client); applyDecorations(); // update decorations (if they changed) - } else if (atom == fbatoms->getFluxboxHintsAtom()) { - client.updateBlackboxHints(); - updateBlackboxHintsFromClient(client); - if (client.getBlackboxHint() != 0 && - (client.getBlackboxHint()->flags & ATTRIB_DECORATION)) { - updateRememberStateFromClient(client); - applyDecorations(); // update decoration - } } break; } @@ -2628,7 +2531,6 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { if (cr.value_mask & CWHeight) ch = cr.height; - // whether we should send ConfigureNotify to netizens // the request is for client window so we resize the frame to it first if (old_w != cw || old_h != ch) { if (old_x != cx || old_y != cy) @@ -3839,75 +3741,6 @@ unsigned int FluxboxWindow::normalHeight() const { int FluxboxWindow::initialState() const { return m_client->initial_state; } -void FluxboxWindow::changeBlackboxHints(const BlackboxHints &net) { - if ((net.flags & ATTRIB_SHADED) && - ((m_blackbox_attrib.attrib & ATTRIB_SHADED) != - (net.attrib & ATTRIB_SHADED))) - shade(); - - if ((net.flags & ATTRIB_HIDDEN) && - ((m_blackbox_attrib.attrib & ATTRIB_HIDDEN) != - (net.attrib & ATTRIB_HIDDEN))) { - bool want_iconic = net.attrib & ATTRIB_HIDDEN; - if (!iconic && want_iconic) - iconify(); - else if (iconic && !want_iconic) - deiconify(); - } - - if (net.flags & (ATTRIB_MAXVERT | ATTRIB_MAXHORIZ)) { - // make maximise look like the net maximise flags - int want_max = MAX_NONE; - - if (net.flags & ATTRIB_MAXVERT) - want_max |= MAX_VERT; - if (net.flags & ATTRIB_MAXHORIZ) - want_max |= MAX_HORZ; - - if (want_max == MAX_NONE && maximized != MAX_NONE) { - maximize(maximized); - } else if (want_max == MAX_FULL && maximized != MAX_FULL) { - maximize(MAX_FULL); - } else { - // either we want vert and aren't - // or we want horizontal and aren't - if (want_max == MAX_VERT ^ (bool)(maximized & MAX_VERT)) - maximize(MAX_VERT); - if (want_max == MAX_HORZ ^ (bool)(maximized & MAX_HORZ)) - maximize(MAX_HORZ); - } - } - - if ((net.flags & ATTRIB_OMNIPRESENT) && - ((m_blackbox_attrib.attrib & ATTRIB_OMNIPRESENT) != - (net.attrib & ATTRIB_OMNIPRESENT))) - stick(); - - if ((net.flags & ATTRIB_WORKSPACE) && - (m_workspace_number != net.workspace)) { - - screen().reassociateWindow(this, net.workspace, true); - - if (screen().currentWorkspaceID() != net.workspace) - hide(true); - else - deiconify(); - } - - if (net.flags & ATTRIB_STACK) { - if ((unsigned int) m_layernum != net.stack) { - moveToLayer(net.stack); - } - } - - if (net.flags & ATTRIB_DECORATION) { - m_old_decoration = static_cast(net.decoration); - setDecoration(m_old_decoration); - } - -} - - void FluxboxWindow::fixsize(int *user_w, int *user_h, bool maximizing) { int titlebar_height = (decorations.titlebar ? frame().titlebar().height() + @@ -3952,7 +3785,7 @@ void FluxboxWindow::moveResizeClient(WinClient &client, int x, int y, frame().clientArea().height()); } -void FluxboxWindow::sendConfigureNotify(bool send_to_netizens) { +void FluxboxWindow::sendConfigureNotify() { ClientList::iterator client_it = m_clientlist.begin(); ClientList::iterator client_it_end = m_clientlist.end(); for (; client_it != client_it_end; ++client_it) { @@ -3970,23 +3803,6 @@ void FluxboxWindow::sendConfigureNotify(bool send_to_netizens) { frame().clientArea().width(), frame().clientArea().height()); - if (send_to_netizens) { - XEvent event; - event.type = ConfigureNotify; - - event.xconfigure.display = display; - event.xconfigure.event = client.window(); - event.xconfigure.window = client.window(); - event.xconfigure.x = frame().x() + frame().clientArea().x(); - event.xconfigure.y = frame().y() + frame().clientArea().y(); - event.xconfigure.width = client.width(); - event.xconfigure.height = client.height(); - event.xconfigure.border_width = client.old_bw; - event.xconfigure.above = frame().window().window(); - event.xconfigure.override_redirect = false; - - screen().updateNetizenConfigNotify(event); - } } // end for } diff --git a/src/Window.hh b/src/Window.hh index d4040fc..29d6054 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -152,11 +152,6 @@ public: LEFT = 7, ALLCORNERS = 8 }; - /// holds old blackbox specific hints - typedef struct _blackbox_hints { - unsigned long flags, attrib, workspace, stack; - long decoration; - } BlackboxHints; /// holds old blackbox attributes typedef struct _blackbox_attributes { @@ -318,7 +313,6 @@ public: */ void maxSize(unsigned int &width, unsigned int &height); void setWorkspace(int n); - void changeBlackboxHints(const BlackboxHints &bh); void updateFunctions(); void restoreAttributes(); /** @@ -521,7 +515,6 @@ private: void updateTitleFromClient(WinClient &client); /// gets icon name from client window void updateMWMHintsFromClient(WinClient &client); - void updateBlackboxHintsFromClient(const WinClient &client); void updateRememberStateFromClient(WinClient &client); void saveBlackboxAttribs(); void associateClientWindow(bool use_attrs = false, int x = 0, int y = 0, unsigned int width = 1, unsigned int height = 1, int gravity = ForgetGravity, unsigned int client_bw = 0); @@ -534,7 +527,7 @@ private: void fixsize(int *user_w = 0, int *user_h = 0, bool maximizing = false); void moveResizeClient(WinClient &client, int x, int y, unsigned int width, unsigned int height); /// sends configurenotify to all clients - void sendConfigureNotify(bool send_to_netizens = true); + void sendConfigureNotify(); static void grabPointer(Window grab_window, Bool owner_events, diff --git a/src/Workspace.cc b/src/Workspace.cc index e1dcc7a..cce8dfe 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -98,15 +98,6 @@ void Workspace::addWindow(FluxboxWindow &w, bool place) { m_windowlist.push_back(&w); m_clientlist_sig.notify(); - if (!w.isStuck()) { - FluxboxWindow::ClientList::iterator client_it = - w.clientList().begin(); - FluxboxWindow::ClientList::iterator client_it_end = - w.clientList().end(); - for (; client_it != client_it_end; ++client_it) - screen().updateNetizenWindowAdd((*client_it)->window(), m_id); - } - } // still_alive is true if the window will continue to exist after diff --git a/src/fluxbox.cc b/src/fluxbox.cc index bad558b..803f911 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -1021,41 +1021,6 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) { winclient->fbwindow()->iconify(); if (ce.data.l[0] == NormalState) winclient->fbwindow()->deiconify(); - } else if (ce.message_type == m_fbatoms->getFluxboxChangeWorkspaceAtom()) { - BScreen *screen = searchScreen(ce.window); - - if (screen && ce.data.l[0] >= 0 && - ce.data.l[0] < (signed)screen->numberOfWorkspaces()) - screen->changeWorkspaceID(ce.data.l[0]); - - } else if (ce.message_type == m_fbatoms->getFluxboxChangeWindowFocusAtom()) { - WinClient *winclient = searchWindow(ce.window); - if (winclient) { - FluxboxWindow *win = winclient->fbwindow(); - if (win && win->isVisible()) - win->setCurrentClient(*winclient, true); - } - } else if (ce.message_type == m_fbatoms->getFluxboxCycleWindowFocusAtom()) { - BScreen *screen = searchScreen(ce.window); - - if (screen) { - if (! ce.data.l[0]) - screen->focusControl().prevFocus(); - else - screen->focusControl().nextFocus(); - } - } else if (ce.message_type == m_fbatoms->getFluxboxChangeAttributesAtom()) { - WinClient *winclient = searchWindow(ce.window); - FluxboxWindow *win = 0; - if (winclient && (win = winclient->fbwindow()) && winclient->validateClient()) { - FluxboxWindow::BlackboxHints net; - net.flags = ce.data.l[0]; - net.attrib = ce.data.l[1]; - net.workspace = ce.data.l[2]; - net.stack = ce.data.l[3]; - net.decoration = static_cast(ce.data.l[4]); - win->changeBlackboxHints(net); - } } else { WinClient *winclient = searchWindow(ce.window); BScreen *screen = searchScreen(ce.window); @@ -1190,8 +1155,6 @@ void Fluxbox::update(FbTk::Subject *changedsub) { BScreen &screen = client->screen(); screen.removeClient(*client); - // finaly send notify signal - screen.updateNetizenWindowDel(client->window()); // At this point, we trust that this client is no longer in the // client list of its frame (but it still has reference to the frame) @@ -1720,7 +1683,6 @@ bool Fluxbox::validateClient(const WinClient *client) const { void Fluxbox::updateFocusedWindow(BScreen *screen, BScreen *old_screen) { if (screen != 0) { - screen->updateNetizenWindowFocus(); for (AtomHandlerContainerIt it= m_atomhandler.begin(); it != m_atomhandler.end(); it++) { (*it).first->updateFocusedWindow(*screen, (FocusControl::focusedWindow() ? @@ -1730,7 +1692,6 @@ void Fluxbox::updateFocusedWindow(BScreen *screen, BScreen *old_screen) { } if (old_screen && old_screen != screen) { - old_screen->updateNetizenWindowFocus(); for (AtomHandlerContainerIt it= m_atomhandler.begin(); it != m_atomhandler.end(); it++) (*it).first->updateFocusedWindow(*old_screen, 0); -- cgit v0.11.2