From 269459e1aa0a8c0ab9be67cf11bb836ecc191f31 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Wed, 1 Oct 2008 01:38:56 -0700 Subject: don't flash original window in the middle of cycling focus --- ChangeLog | 2 ++ src/FbTk/Layer.hh | 3 ++- src/FbTk/MultLayers.hh | 5 ++--- src/FbTk/XLayer.cc | 16 ++++++++++++---- src/FbTk/XLayer.hh | 5 +++-- src/FocusControl.cc | 2 -- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 700e2ee..a734149 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ (Format: Year/Month/Day) Changes for 1.1.2 *08/10/01: + * Don't flash original window while cycling (Mark) + FocusControl.cc FbTk/XLayer.cc/hh * Reset background when screen changes resolution (Mark) Screen.cc RootTheme.cc/hh * Restore missing config files on reconfigure (Mark) diff --git a/src/FbTk/Layer.hh b/src/FbTk/Layer.hh index 405285c..b9257c3 100644 --- a/src/FbTk/Layer.hh +++ b/src/FbTk/Layer.hh @@ -43,7 +43,6 @@ public: virtual void raise(ItemType &item); /// move item to bottom virtual void lower(ItemType &item); - virtual void restack(); /// @return layer item on specific position, on failure 0 ItemType *getItem(unsigned int position); /// @return number of elements in layer @@ -52,6 +51,8 @@ public: const ListType &itemList() const { return m_list; } /// @return layer list ListType &itemList() { return m_list; } +protected: + virtual void restack(); private: ListType m_list; }; diff --git a/src/FbTk/MultLayers.hh b/src/FbTk/MultLayers.hh index e502ed6..2e3915d 100644 --- a/src/FbTk/MultLayers.hh +++ b/src/FbTk/MultLayers.hh @@ -52,7 +52,6 @@ public: void moveToLayer(XLayerItem &item, int layernum); int size(); - void restack(); XLayer *getLayer(size_t num); const XLayer *getLayer(size_t num) const; @@ -62,10 +61,10 @@ public: void unlock() { if (--m_lock == 0) restack(); } private: - std::vector m_layers; + void restack(); + std::vector m_layers; int m_lock; - }; }; diff --git a/src/FbTk/XLayer.cc b/src/FbTk/XLayer.cc index 0d878d3..2d92080 100644 --- a/src/FbTk/XLayer.cc +++ b/src/FbTk/XLayer.cc @@ -37,7 +37,7 @@ using std::endl; #endif // DEBUG XLayer::XLayer(MultLayers &manager, int layernum): - m_manager(manager), m_layernum(layernum) { + m_manager(manager), m_layernum(layernum), m_needs_restack(false) { } XLayer::~XLayer() { @@ -70,6 +70,7 @@ void XLayer::restack() { delete [] winlist; + m_needs_restack = false; } int XLayer::countWindows() { @@ -177,8 +178,11 @@ void XLayer::remove(XLayerItem &item) { void XLayer::raise(XLayerItem &item) { // assume it is already in this layer - if (&item == itemList().front()) + if (&item == itemList().front()) { + if (m_needs_restack) + restack(); return; // nothing to do + } iterator it = find(itemList().begin(), itemList().end(), &item); if (it != itemList().end()) @@ -198,7 +202,7 @@ void XLayer::raise(XLayerItem &item) { void XLayer::tempRaise(XLayerItem &item) { // assume it is already in this layer - if (&item == itemList().front()) + if (!m_needs_restack && &item == itemList().front()) return; // nothing to do iterator it = find(itemList().begin(), itemList().end(), &item); @@ -212,14 +216,18 @@ void XLayer::tempRaise(XLayerItem &item) { // don't add it back to the top stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum)); + m_needs_restack = true; } void XLayer::lower(XLayerItem &item) { // assume already in this layer // is it already the lowest? - if (&item == itemList().back()) + if (&item == itemList().back()) { + if (m_needs_restack) + restack(); return; // nothing to do + } iterator it = find(itemList().begin(), itemList().end(), &item); if (it != itemList().end()) diff --git a/src/FbTk/XLayer.hh b/src/FbTk/XLayer.hh index acc299c..bfd7010 100644 --- a/src/FbTk/XLayer.hh +++ b/src/FbTk/XLayer.hh @@ -44,7 +44,6 @@ public: void setLayerNum(int layernum) { m_layernum = layernum; }; int getLayerNum() { return m_layernum; }; - void restack(); // Put all items on the same layer (called when layer item added to) void alignItem(XLayerItem &item); int countWindows(); @@ -73,9 +72,11 @@ public: void moveToLayer(XLayerItem &item, int layernum); private: + void restack(); + MultLayers &m_manager; int m_layernum; - + bool m_needs_restack; }; } // namespace FbTk diff --git a/src/FocusControl.cc b/src/FocusControl.cc index ce46dcc..78752bb 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc @@ -146,8 +146,6 @@ void FocusControl::cycleFocus(const FocusableList &window_list, // if we were already cycling, then restore the old state if (m_cycling_last) { - m_screen.layerManager().restack(); - // set back to originally selected window in that group m_cycling_last->fbwindow()->setCurrentClient(*m_cycling_last, false); -- cgit v0.11.2