From 2f1f364fa2d7c72b93d4dbcde321abace5e2109d Mon Sep 17 00:00:00 2001 From: rathnor Date: Sat, 19 Jul 2003 11:55:49 +0000 Subject: fix up xinerama for heads of toolbar and slit --- ChangeLog | 2 ++ src/Slit.cc | 11 +++++++++-- src/Slit.hh | 4 ++-- src/Toolbar.cc | 9 +++++++-- src/Toolbar.hh | 5 ++++- src/Window.cc | 5 +++-- src/Xinerama.hh | 18 +++++++++--------- src/fluxbox.hh | 4 +++- 8 files changed, 39 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10a82f1..d2619be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ (Format: Year/Month/Day) Changes for 0.9.5: *03/07/19: + * Fix xinerama options (again) for Slit and Toolbar (Simon) + Xinerama.hh Slit.hh/cc Toolbar.hh/cc * Move menu alpha setting into MenuTheme (Simon) - fixes alpha init on multi-screened machines MenuTheme.hh/cc Menu.hh/cc Screen.cc diff --git a/src/Slit.cc b/src/Slit.cc index 69d4824..da2b860 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Slit.cc,v 1.72 2003/07/18 15:40:55 rathnor Exp $ +// $Id: Slit.cc,v 1.73 2003/07/19 11:55:49 rathnor Exp $ #include "Slit.hh" @@ -1263,7 +1263,7 @@ void Slit::setupMenu() { screen(), screen().imageControl(), *screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), - this + *this )); } @@ -1344,3 +1344,10 @@ void Slit::moveToLayer(int layernum) { m_layeritem->moveToLayer(layernum); *m_rc_layernum = layernum; } + +void Slit::saveOnHead(int head) { + m_rc_on_head = head; + // reposition + reconfigure(); +} + diff --git a/src/Slit.hh b/src/Slit.hh index 5fa80bd..023d35d 100644 --- a/src/Slit.hh +++ b/src/Slit.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -/// $Id: Slit.hh,v 1.35 2003/06/24 13:42:23 fluxgen Exp $ +/// $Id: Slit.hh,v 1.36 2003/07/19 11:55:49 rathnor Exp $ #ifndef SLIT_HH #define SLIT_HH @@ -68,7 +68,7 @@ public: inline Direction direction() const { return *m_rc_direction; } inline Placement placement() const { return *m_rc_placement; } inline int getOnHead() const { return *m_rc_on_head; } - inline void saveOnHead(int head) { m_rc_on_head = head; } + void saveOnHead(int head); FbTk::Menu &menu() { return m_slitmenu; } inline const FbTk::FbWindow &window() const { return frame.window; } diff --git a/src/Toolbar.cc b/src/Toolbar.cc index e0f4424..251d8dd 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.101 2003/07/18 15:40:55 rathnor Exp $ +// $Id: Toolbar.cc,v 1.102 2003/07/19 11:55:49 rathnor Exp $ #include "Toolbar.hh" @@ -1397,7 +1397,7 @@ void Toolbar::setupMenus() { tbar.screen(), tbar.screen().imageControl(), *tbar.screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), - &tbar + tbar )); } @@ -1442,3 +1442,8 @@ void Toolbar::setupMenus() { tbar.placementMenu().update(); menu.update(); } + +void Toolbar::saveOnHead(int head) { + m_rc_on_head = head; + reconfigure(); +} diff --git a/src/Toolbar.hh b/src/Toolbar.hh index 59b1600..70b30e2 100644 --- a/src/Toolbar.hh +++ b/src/Toolbar.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.hh,v 1.38 2003/07/10 15:52:58 fluxgen Exp $ +// $Id: Toolbar.hh,v 1.39 2003/07/19 11:55:49 rathnor Exp $ #ifndef TOOLBAR_HH #define TOOLBAR_HH @@ -118,6 +118,9 @@ public: inline ToolbarTheme &theme() { return m_theme; } bool isVertical() const; + inline int getOnHead() const { return *m_rc_on_head; } + void saveOnHead(int head); + /** @name eventhandlers */ diff --git a/src/Window.cc b/src/Window.cc index a1be00e..ca6ab99 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.204 2003/07/17 17:56:28 rathnor Exp $ +// $Id: Window.cc,v 1.205 2003/07/19 11:55:49 rathnor Exp $ #include "Window.hh" @@ -698,7 +698,8 @@ bool FluxboxWindow::detachClient(WinClient &client) { removeClient(client); - client.m_win = screen().createWindow(client); + // m_client must be valid as there should be at least one other window + // otherwise this wouldn't be here (refer numClients() <= 1 return) m_client->raise(); setInputFocus(); return true; diff --git a/src/Xinerama.hh b/src/Xinerama.hh index ad4b3c0..8bbd3d1 100644 --- a/src/Xinerama.hh +++ b/src/Xinerama.hh @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Xinerama.hh,v 1.3 2003/07/10 11:58:36 fluxgen Exp $ +// $Id: Xinerama.hh,v 1.4 2003/07/19 11:55:49 rathnor Exp $ #ifndef XINERAMA_HH #define XINERAMA_HH @@ -42,20 +42,20 @@ template class XineramaHeadMenuItem : public FbTk::MenuItem { public: - XineramaHeadMenuItem(const char *label, ItemType *object, int headnum, + XineramaHeadMenuItem(const char *label, ItemType &object, int headnum, FbTk::RefCount &cmd): FbTk::MenuItem(label,cmd), m_object(object), m_headnum(headnum) {} - XineramaHeadMenuItem(const char *label, ItemType *object, int headnum): + XineramaHeadMenuItem(const char *label, ItemType &object, int headnum): FbTk::MenuItem(label), m_object(object), m_headnum(headnum) {} - bool isEnabled() const { return true; } //m_object->screen().getOnHead(*m_object) != m_headnum; } ; + bool isEnabled() const { return m_object.getOnHead() != m_headnum; } void click(int button, int time) { - // m_object->screen().setOnHead(*m_object, m_headnum); + m_object.saveOnHead(m_headnum); FbTk::MenuItem::click(button, time); } private: - ItemType *m_object; + ItemType &m_object; int m_headnum; }; @@ -65,16 +65,16 @@ template class XineramaHeadMenu : public FbMenu { public: XineramaHeadMenu(MenuTheme &tm, BScreen &screen, FbTk::ImageControl &imgctrl, - FbTk::XLayer &layer, ItemType *item); + FbTk::XLayer &layer, ItemType &item); private: - ItemType *m_object; + ItemType &m_object; }; template XineramaHeadMenu::XineramaHeadMenu(MenuTheme &tm, BScreen &screen, FbTk::ImageControl &imgctrl, - FbTk::XLayer &layer, ItemType *item): + FbTk::XLayer &layer, ItemType &item): FbMenu(tm, screen.screenNumber(), imgctrl, layer), m_object(item) { diff --git a/src/fluxbox.hh b/src/fluxbox.hh index 5ce37ab..d4c109c 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.hh,v 1.65 2003/07/18 15:40:55 rathnor Exp $ +// $Id: fluxbox.hh,v 1.66 2003/07/19 11:55:49 rathnor Exp $ #ifndef FLUXBOX_HH #define FLUXBOX_HH @@ -118,6 +118,8 @@ public: inline int getNumberOfLayers() const { return *m_rc_numlayers; } // class to store layer numbers (special Resource type) + // we have a special resource type because we need to be able to name certain layers + // a Resource wouldn't allow this class Layer { public: explicit Layer(int i) : m_num(i) {}; -- cgit v0.11.2