aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-09-13 19:06:40 (GMT)
committerMathias Gumz <akira@fluxbox.org>2016-09-21 18:52:14 (GMT)
commitc69d5afb64b3ce90190cd5e0515020afb48a8b39 (patch)
tree854d625157c86643e815e4df2bbc834c09a91464 /src
parentbc1ad61a7d6f10debc5781032e428f297a6b2fad (diff)
downloadfluxbox-c69d5afb64b3ce90190cd5e0515020afb48a8b39.zip
fluxbox-c69d5afb64b3ce90190cd5e0515020afb48a8b39.tar.bz2
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.
Diffstat (limited to 'src')
-rw-r--r--src/IconButton.hh2
-rw-r--r--src/Window.cc16
-rw-r--r--src/Window.hh1
3 files changed, 14 insertions, 5 deletions
diff --git a/src/IconButton.hh b/src/IconButton.hh
index d3cb3d8..4bb57e7 100644
--- a/src/IconButton.hh
+++ b/src/IconButton.hh
@@ -66,6 +66,7 @@ public:
66 bool setOrientation(FbTk::Orientation orient); 66 bool setOrientation(FbTk::Orientation orient);
67 67
68 virtual unsigned int preferredWidth() const; 68 virtual unsigned int preferredWidth() const;
69 void showTooltip();
69 70
70 const FbTk::Signal<> &titleChanged() { return m_title_changed; } 71 const FbTk::Signal<> &titleChanged() { return m_title_changed; }
71 72
@@ -74,7 +75,6 @@ protected:
74private: 75private:
75 void reconfigAndClear(); 76 void reconfigAndClear();
76 void setupWindow(); 77 void setupWindow();
77 void showTooltip();
78 78
79 /// Refresh all pixmaps and windows 79 /// Refresh all pixmaps and windows
80 /// @param setup Wether to setup window again. 80 /// @param setup Wether to setup window again.
diff --git a/src/Window.cc b/src/Window.cc
index 5eaf0d5..1e32bd5 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -2774,10 +2774,13 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2774 Fluxbox::instance()->keys()->doAction(ev.type, ev.state, 0, 2774 Fluxbox::instance()->keys()->doAction(ev.type, ev.state, 0,
2775 Keys::ON_WINDOW, m_client); 2775 Keys::ON_WINDOW, m_client);
2776 2776
2777 WinClient *client = 0; 2777 // determine if we're in a label button (tab)
2778 if (screen().focusControl().isMouseTabFocus()) { 2778 WinClient *client = winClientOfLabelButtonWindow(ev.window);
2779 // determine if we're in a label button (tab) 2779 if (client) {
2780 client = winClientOfLabelButtonWindow(ev.window); 2780 if (IconButton *tab = m_labelbuttons[client]) {
2781 m_has_tooltip = true;
2782 tab->showTooltip();
2783 }
2781 } 2784 }
2782 2785
2783 if (ev.window == frame().window() || 2786 if (ev.window == frame().window() ||
@@ -2818,6 +2821,11 @@ void FluxboxWindow::leaveNotifyEvent(XCrossingEvent &ev) {
2818 return; 2821 return;
2819 } 2822 }
2820 2823
2824 if (m_has_tooltip) {
2825 m_has_tooltip = false;
2826 screen().hideTooltip();
2827 }
2828
2821 // still inside? 2829 // still inside?
2822 if (ev.x_root > frame().x() && ev.y_root > frame().y() && 2830 if (ev.x_root > frame().x() && ev.y_root > frame().y() &&
2823 ev.x_root <= (int)(frame().x() + frame().width()) && 2831 ev.x_root <= (int)(frame().x() + frame().width()) &&
diff --git a/src/Window.hh b/src/Window.hh
index b6e56b2..0cfe73a 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -576,6 +576,7 @@ private:
576 WinClient *m_client; ///< current client 576 WinClient *m_client; ///< current client
577 typedef std::map<WinClient *, IconButton *> Client2ButtonMap; 577 typedef std::map<WinClient *, IconButton *> Client2ButtonMap;
578 Client2ButtonMap m_labelbuttons; 578 Client2ButtonMap m_labelbuttons;
579 bool m_has_tooltip;
579 580
580 SizeHints m_size_hint; 581 SizeHints m_size_hint;
581 struct { 582 struct {