Compare commits

...
Author SHA1 Message Date
Hanif Koh 6d218f9abf Let Plugin Windows Be Maximized on X11
wxGTK types every wxDialog as a dialog window, and Mutter offers no
maximize for anything but a normal window, so the maximize button and
shortcut did nothing on GNOME under X11. Modeless plugin windows are now
normal windows, kept off the taskbar as before. Modal ones stay dialogs
so the window manager keeps routing focus from the main window to them.
2026-10-10 14:27:45 +08:00
3 changed files with 20 additions and 0 deletions
+15
View File
@@ -13,6 +13,10 @@
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/webview.h> #include <wx/webview.h>
#ifdef __WXGTK__
#include <gtk/gtk.h>
#endif
namespace Slic3r { namespace GUI { namespace Slic3r { namespace GUI {
WebDialog::WebDialog(wxWindow* parent, WebDialog::WebDialog(wxWindow* parent,
@@ -52,6 +56,17 @@ WebDialog::WebDialog(wxWindow* parent,
Bind(wxEVT_CLOSE_WINDOW, &WebDialog::on_close_window, this); Bind(wxEVT_CLOSE_WINDOW, &WebDialog::on_close_window, this);
} }
void WebDialog::use_normal_window_type()
{
#ifdef __WXGTK__
// wxGTK types every wxDialog as a dialog, and Mutter offers no maximize for anything but a
// normal window. Mutter also stops hiding a normal window from the taskbar, so keep it hidden
// as a dialog with a parent is everywhere else.
gtk_window_set_type_hint(GTK_WINDOW(m_widget), GDK_WINDOW_TYPE_HINT_NORMAL);
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(m_widget), TRUE);
#endif
}
void WebDialog::add_user_scripts() void WebDialog::add_user_scripts()
{ {
if (wxWebView* wv = browser()) { if (wxWebView* wv = browser()) {
+4
View File
@@ -62,6 +62,10 @@ public:
bool is_open() const { return m_open; } bool is_open() const { return m_open; }
// Lets a modeless window be maximized on X11; call before Show(). Modal ones stay dialogs so the
// window manager keeps routing focus from the parent to them.
void use_normal_window_type();
// The payload submitted via window.orca.submit() (modal use), if any. // The payload submitted via window.orca.submit() (modal use), if any.
const std::optional<nlohmann::json>& result() const { return m_result; } const std::optional<nlohmann::json>& result() const { return m_result; }
+1
View File
@@ -399,6 +399,7 @@ py::object ui_create_window(const std::string& html, const std::string& title, i
if (UiRegistry::instance().is_open(new_id)) if (UiRegistry::instance().is_open(new_id))
dlg->Destroy(); dlg->Destroy();
} else { } else {
dlg->use_normal_window_type();
dlg->Show(); dlg->Show();
} }
}); });