all repos — fluxbox @ c5e5009c2faf48db34ae2d15fda05ba1c46e10d9

custom fork of the fluxbox windowmanager

clean ups of reconfigure/redraws
rathnor rathnor
commit

c5e5009c2faf48db34ae2d15fda05ba1c46e10d9

parent

80c1f78cb55923980a2121dac2dfa2d330669fdd

5 files changed, 32 insertions(+), 31 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,9 @@

(Format: Year/Month/Day) Changes for 0.9.2: +*03/05/01: + * Clean ups and optimising of redraw/reconfigures + Also fixes warping in outline focus bug (Simon) + Window.hh/cc FbWinFrame.hh/cc *03/04/29: * fix cause of (some?) excessive reconfigures (Simon) fluxbox.cc
M src/FbWinFrame.ccsrc/FbWinFrame.cc

@@ -19,7 +19,7 @@ // 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. -// $Id: FbWinFrame.cc,v 1.22 2003/04/16 22:15:22 fluxgen Exp $ +// $Id: FbWinFrame.cc,v 1.23 2003/05/01 13:19:36 rathnor Exp $ #include "FbWinFrame.hh" #include "ImageControl.hh"

@@ -69,6 +69,7 @@ m_bevel(1),

m_use_titlebar(true), m_use_handle(true), m_focused(false), + m_visible(false), m_button_pm(0), m_themelistener(*this) {

@@ -124,12 +125,14 @@ }

void FbWinFrame::hide() { m_window.hide(); + m_visible = false; } void FbWinFrame::show() { + m_visible = true; + reconfigure(); m_window.showSubwindows(); m_window.show(); - reconfigure(); } /**

@@ -534,12 +537,13 @@ grip_width, grip_height);

} } + if (!m_visible) return; + // render the theme renderButtons(); if (!m_shaded) renderHandles(); - redrawTitle(); - redrawTitlebar(); + // titlebar stuff rendered already by reconftitlebar } unsigned int FbWinFrame::titleHeight() const {

@@ -557,7 +561,7 @@ /**

aligns and redraws title */ void FbWinFrame::redrawTitle() { - if (m_labelbuttons.size() == 0) + if (m_labelbuttons.size() == 0 || !m_visible) return; int button_width = label().width()/m_labelbuttons.size();

@@ -581,12 +585,12 @@

} void FbWinFrame::redrawTitlebar() { - if (!m_use_titlebar) + if (!m_use_titlebar || !m_visible) return; m_titlebar.clear(); m_label.clear(); redrawTitle(); -} + } /** Align buttons with title text window

@@ -637,7 +641,7 @@ m_titlebar.raise(); // always on top

} void FbWinFrame::renderTitlebar() { - if (!m_use_titlebar) + if (!m_use_titlebar || !m_visible) return; // render pixmaps

@@ -679,12 +683,12 @@ else

m_titlebar.setBackgroundColor(title_color); renderLabelButtons(); - redrawTitle(); + redrawTitlebar(); } void FbWinFrame::renderHandles() { - if (!m_use_handle) + if (!m_use_handle || !m_visible) return; render(m_theme.handleFocusTexture(), m_handle_focused_color, m_handle_focused_pm,

@@ -741,6 +745,7 @@ m_handle.clear();

} void FbWinFrame::renderButtons() { + if (!m_visible) return; render(m_theme.buttonFocusTexture(), m_button_color, m_button_pm, m_button_size, m_button_size);

@@ -785,7 +790,6 @@ // note: we don't show clientarea yet

setEventHandler(*this); - reconfigureTitlebar(); reconfigure(); }

@@ -864,6 +868,7 @@ title_color = m_title_unfocused_color;

} void FbWinFrame::renderLabelButtons() { + if (!m_visible) return; Pixmap label_pm = None; Pixmap not_used_pm = None; FbTk::Color label_color;
M src/FbWinFrame.hhsrc/FbWinFrame.hh

@@ -19,7 +19,7 @@ // 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. -// $Id: FbWinFrame.hh,v 1.6 2003/04/16 12:24:28 fluxgen Exp $ +// $Id: FbWinFrame.hh,v 1.7 2003/05/01 13:19:36 rathnor Exp $ #ifndef FBWINFRAME_HH #define FBWINFRAME_HH

@@ -67,6 +67,7 @@ bool double_click=false, bool pressed=false);

void hide(); void show(); + inline bool isVisible() const { return m_visible; } /// shade frame (ie resize to titlebar size) void shade(); void move(int x, int y);

@@ -210,6 +211,7 @@ int m_bevel; ///< bevel between titlebar items and titlebar

bool m_use_titlebar; ///< if we should use titlebar bool m_use_handle; ///< if we should use handle bool m_focused; ///< focused/unfocused mode + bool m_visible; ///< if we are currently showing /** @name pixmaps and colors for rendering
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // 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. -// $Id: Window.cc,v 1.155 2003/04/28 13:38:23 rathnor Exp $ +// $Id: Window.cc,v 1.156 2003/05/01 13:19:36 rathnor Exp $ #include "Window.hh"

@@ -201,7 +201,7 @@ m_layersig(*this),

m_workspacesig(*this), m_diesig(*this), moving(false), resizing(false), shaded(false), maximized(false), - visible(false), iconic(false), transient(false), focused(false), + iconic(false), transient(false), focused(false), stuck(false), modal(false), send_focus_message(false), m_managed(false), screen(scr), timer(this),

@@ -233,7 +233,7 @@ m_layersig(*this),

m_workspacesig(*this), m_diesig(*this), moving(false), resizing(false), shaded(false), maximized(false), - visible(false), iconic(false), transient(false), focused(false), + iconic(false), transient(false), focused(false), stuck(false), modal(false), send_focus_message(false), m_managed(false), screen(scr), timer(this),

@@ -850,7 +850,6 @@ void FluxboxWindow::getWMHints() {

//!! XWMHints *wmhint = XGetWMHints(display, m_client->window()); if (! wmhint) { - visible = true; iconic = false; focus_mode = F_PASSIVE; m_client->window_group = None;

@@ -1152,11 +1151,10 @@ } else {

return false; } - m_frame.setFocus(true); screen.setFocusedWindow(*m_client); Fluxbox::instance()->setFocusedWindow(this); - + if (send_focus_message) m_client->sendFocus();

@@ -1191,7 +1189,6 @@ if (isIconic()) // no need to iconify if we're already

return; m_windowmenu.hide(); - visible = false; iconic = true; setState(IconicState);

@@ -1229,7 +1226,6 @@

bool was_iconic = iconic; iconic = false; - visible = true; setState(NormalState); ClientList::iterator client_it = clientList().begin();

@@ -1283,7 +1279,6 @@ /**

Set window in withdrawn state */ void FluxboxWindow::withdraw() { - visible = false; iconic = false; if (isResizing())

@@ -1989,7 +1984,7 @@ WinClient *client = findClient(ne.window);

if (client == 0) return; - if (!ne.override_redirect && visible) { + if (!ne.override_redirect && isVisible()) { Fluxbox *fluxbox = Fluxbox::instance(); fluxbox->grab(); if (! validateClient())

@@ -2005,7 +2000,6 @@

if (focused) m_frame.setFocus(true); - visible = true; iconic = false; // Auto-group from tab?

@@ -2468,13 +2462,11 @@ if (ev.mode == NotifyGrab ||

!isVisible()) { return; } - if (ev.window == frame().window() || ev.window == m_client->window()) { if ((screen.isSloppyFocus() || screen.isSemiSloppyFocus()) && !isFocused()) { - // check that there aren't any subsequent leave notify events in the // X event queue XEvent dummy;

@@ -2482,11 +2474,9 @@ scanargs sa;

sa.w = ev.window; sa.enter = sa.leave = False; XCheckIfEvent(display, &dummy, queueScanner, (char *) &sa); - + if ((!sa.leave || sa.inferior) && setInputFocus()) installColormap(True); - - } } }
M src/Window.hhsrc/Window.hh

@@ -22,7 +22,7 @@ // 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. -// $Id: Window.hh,v 1.65 2003/04/28 13:38:23 rathnor Exp $ +// $Id: Window.hh,v 1.66 2003/05/01 13:19:36 rathnor Exp $ #ifndef WINDOW_HH #define WINDOW_HH

@@ -242,7 +242,7 @@ bool isTransient() const;

bool hasTransient() const; inline bool isManaged() const { return m_managed; } inline bool isFocused() const { return focused; } - inline bool isVisible() const { return visible; } + inline bool isVisible() const { return m_frame.isVisible(); } inline bool isIconic() const { return iconic; } inline bool isShaded() const { return shaded; } inline bool isMaximized() const { return maximized; }

@@ -387,7 +387,7 @@ std::string m_instance_name; /// instance name from WM_CLASS

std::string m_class_name; /// class name from WM_CLASS //Window state - bool moving, resizing, shaded, maximized, visible, iconic, transient, + bool moving, resizing, shaded, maximized, iconic, transient, focused, stuck, modal, send_focus_message, m_managed; WinClient *m_attaching_tab;