diff options
author | Nikolay <MPolianovskyi@wavesglobal.com> | 2015-03-25 10:55:55 +0200 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-29 14:16:43 -0400 |
commit | 7e097c5efcf10f17434c0497d404e6353f087a40 (patch) | |
tree | de4987e7888349a9ff2973befdb7e6b686661a4e /libs/gtkmm2ext/persistent_tooltip.cc | |
parent | 4465fb62f3afc1162cda4e9dd0c66b77bf45ba21 (diff) |
[Summary] Bug fix #44332 "Please fit the Pan values monitor to channel borders"
[Feature reviewed] AMishyn
[Reviewed] VKamyshniy
Fixed up by Paul Davis to fix logic mistakes and unnecessary complexity,
and indentation.
Conflicts:
libs/gtkmm2ext/persistent_tooltip.cc
Diffstat (limited to 'libs/gtkmm2ext/persistent_tooltip.cc')
-rw-r--r-- | libs/gtkmm2ext/persistent_tooltip.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/libs/gtkmm2ext/persistent_tooltip.cc b/libs/gtkmm2ext/persistent_tooltip.cc index d9ccfa15f7..61eb4884f5 100644 --- a/libs/gtkmm2ext/persistent_tooltip.cc +++ b/libs/gtkmm2ext/persistent_tooltip.cc @@ -21,6 +21,8 @@ #include <gtkmm/label.h> #include "gtkmm2ext/persistent_tooltip.h" +#include "pbd/stacktrace.h" + #include "i18n.h" using namespace std; @@ -60,7 +62,7 @@ bool PersistentTooltip::timeout () { show (); - return false; + return true; } bool @@ -114,6 +116,7 @@ PersistentTooltip::show () if (_tip.empty()) { return; } + if (!_window) { _window = new Window (WINDOW_POPUP); _window->set_name (X_("ContrastingPopup")); @@ -136,18 +139,22 @@ PersistentTooltip::show () set_tip (_tip); if (!_window->is_visible ()) { - int rx, ry, sw; - sw= gdk_screen_width(); - _target->get_window()->get_origin (rx, ry); - _window->move (rx, ry + _target->get_height() + _margin_y); - _window->present (); + int rx, ry; + int sw = gdk_screen_width(); + _target->get_window()->get_origin (rx, ry); + /* the window needs to be realized first * for _window->get_width() to be correct. */ + + _window->present (); + if (sw < rx + _window->get_width()) { rx = sw - _window->get_width(); _window->move (rx, ry + _target->get_height()); + } else { + _window->move (rx + (_target->get_width () - _window->get_width ()) / 2, ry + _target->get_height()); } } } |