all repos — fluxbox @ c69d5afb64b3ce90190cd5e0515020afb48a8b39

custom fork of the fluxbox windowmanager

show tooltips for tabs

on the run (yes sucks, sorry) fixes a bug where windows were not
activated on hovering the tab (for focus-follows-mouse policies)

REQUEST: 95

The iconbar already shows tooltips and I doubt the claim that (untabbed)
titlebars are "often" too short for the window title.
Thomas Lübking thomas.luebking@gmail.com
commit

c69d5afb64b3ce90190cd5e0515020afb48a8b39

parent

bc1ad61a7d6f10debc5781032e428f297a6b2fad

3 files changed, 14 insertions(+), 5 deletions(-)

jump to
M src/IconButton.hhsrc/IconButton.hh

@@ -66,6 +66,7 @@

bool setOrientation(FbTk::Orientation orient); virtual unsigned int preferredWidth() const; + void showTooltip(); const FbTk::Signal<> &titleChanged() { return m_title_changed; }

@@ -74,7 +75,6 @@ void drawText(int x, int y, FbTk::FbDrawable *drawable_override);

private: void reconfigAndClear(); void setupWindow(); - void showTooltip(); /// Refresh all pixmaps and windows /// @param setup Wether to setup window again.
M src/Window.ccsrc/Window.cc

@@ -2774,10 +2774,13 @@ if (ev.window == frame().window())

Fluxbox::instance()->keys()->doAction(ev.type, ev.state, 0, Keys::ON_WINDOW, m_client); - WinClient *client = 0; - if (screen().focusControl().isMouseTabFocus()) { - // determine if we're in a label button (tab) - client = winClientOfLabelButtonWindow(ev.window); + // determine if we're in a label button (tab) + WinClient *client = winClientOfLabelButtonWindow(ev.window); + if (client) { + if (IconButton *tab = m_labelbuttons[client]) { + m_has_tooltip = true; + tab->showTooltip(); + } } if (ev.window == frame().window() ||

@@ -2816,6 +2819,11 @@ // ignore grab activates, or if we're not visible

if (ev.mode == NotifyGrab || ev.mode == NotifyUngrab || !isVisible()) { return; + } + + if (m_has_tooltip) { + m_has_tooltip = false; + screen().hideTooltip(); } // still inside?
M src/Window.hhsrc/Window.hh

@@ -576,6 +576,7 @@ ClientList m_clientlist;

WinClient *m_client; ///< current client typedef std::map<WinClient *, IconButton *> Client2ButtonMap; Client2ButtonMap m_labelbuttons; + bool m_has_tooltip; SizeHints m_size_hint; struct {