diff options
| -rw-r--r-- | examples/hello-world/hello.cpp | 2 | ||||
| -rw-r--r-- | include/adwaitamm/applicationwindow.hpp | 2 | ||||
| -rw-r--r-- | src/applicationwindow.cpp | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/examples/hello-world/hello.cpp b/examples/hello-world/hello.cpp index ddcbc7a..dd8aa56 100644 --- a/examples/hello-world/hello.cpp +++ b/examples/hello-world/hello.cpp @@ -5,7 +5,7 @@ auto main(int argc, char ** argv) -> int auto app = Adwaita::Application::create("org.example.Hello"); app->signal_activate().connect([app] { - auto window = new Adwaita::ApplicationWindow{*app}; + auto window = new Adwaita::ApplicationWindow{app}; app->signal_shutdown().connect([window] { delete window; }); window->present(); diff --git a/include/adwaitamm/applicationwindow.hpp b/include/adwaitamm/applicationwindow.hpp index c2fa0d1..bef520d 100644 --- a/include/adwaitamm/applicationwindow.hpp +++ b/include/adwaitamm/applicationwindow.hpp @@ -36,7 +36,7 @@ namespace Adwaita using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj; using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj_copy; - explicit ApplicationWindow(Gtk::Application & app); + explicit ApplicationWindow(Glib::RefPtr<Gtk::Application> const & app); ApplicationWindow(ApplicationWindow const & other) = delete; ApplicationWindow(ApplicationWindow && other) noexcept = default; diff --git a/src/applicationwindow.cpp b/src/applicationwindow.cpp index 92f5997..1de245f 100644 --- a/src/applicationwindow.cpp +++ b/src/applicationwindow.cpp @@ -10,6 +10,7 @@ #include <glibmm/object.h> #include <glibmm/objectbase.h> +#include <glibmm/refptr.h> #include <glibmm/wrap.h> #include <gtkmm/application.h> @@ -35,9 +36,9 @@ namespace Adwaita return adw_application_window_get_type(); } - ApplicationWindow::ApplicationWindow(Gtk::Application & app) + ApplicationWindow::ApplicationWindow(Glib::RefPtr<Gtk::Application> const & app) : Glib::ObjectBase{nullptr} - , Gtk::ApplicationWindow{GTK_APPLICATION_WINDOW(adw_application_window_new(unwrap(&app)))} + , Gtk::ApplicationWindow{GTK_APPLICATION_WINDOW(adw_application_window_new(unwrap(app)))} { } |
