13
0

Honor "floating windows are dialogs" for tearoffs

This commit is contained in:
Robin Gareus 2021-07-22 04:37:42 +02:00
parent dabcb57b6b
commit 6c6f2df849
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 12 additions and 1 deletions

View File

@ -25,6 +25,7 @@
#include "gtkmm2ext/utils.h"
#include "widgets/tearoff.h"
#include "widgets/ui_config.h"
#include "pbd/i18n.h"
@ -70,7 +71,16 @@ TearOff::TearOff (Widget& c, bool allow_resize)
own_window.add_events (KEY_PRESS_MASK|KEY_RELEASE_MASK|BUTTON_PRESS_MASK|BUTTON_RELEASE_MASK|POINTER_MOTION_MASK|POINTER_MOTION_HINT_MASK);
own_window.set_resizable (allow_resize);
own_window.set_type_hint (WINDOW_TYPE_HINT_UTILITY);
#ifdef __APPLE__
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
#else
if (UIConfigurationBase::instance().get_all_floating_windows_are_dialogs ()) {
own_window.set_type_hint (WINDOW_TYPE_HINT_DIALOG);
} else {
own_window.set_type_hint (WINDOW_TYPE_HINT_UTILITY);
}
#endif
own_window.add (window_box);

View File

@ -41,6 +41,7 @@ public:
sigc::signal<void> ColorsChanged;
virtual float get_ui_scale () = 0;
virtual bool get_all_floating_windows_are_dialogs () const = 0;
virtual bool get_widget_prelight () const = 0;
virtual Gtkmm2ext::Color color (const std::string&, bool* failed = 0) const = 0;
};