Clemapfel / Mousetrap.jl

Finally, a GUI Engine made for Julia
https://clemens-cords.com/mousetrap
GNU Lesser General Public License v3.0
403 stars 9 forks source link

Hide on close for windows is broken ? #79

Open MichaelSchloesser opened 7 months ago

MichaelSchloesser commented 7 months ago

I recently updated some packages, including Mousetrap and windows do not seem to hide anymore after closing them. Instead they just become uninteractable. Similarly the "dropdown windows" of menubars do not vanish anymore (even if i move the window around).

Here is an adapted version of the example in #58. Naturally i also tested this in a fresh enviroment.

function Mousetrap.set_transient_for!(self::Window, other::Window)
    Mousetrap.detail.set_transient_for!(self._internal, other._internal)
end

main() do app::Application
    main_window = Window(app)
    other_window = Window(app)
    set_hide_on_close!(other_window, true)
    set_transient_for!(other_window, main_window)

    button = Button()

    set_child!(main_window, button)

    open_other_window = Action("open_other_window.action", app) do x
        set_is_modal!(other_window, true)
        present!(other_window)

        return nothing
    end
    set_action!(button, open_other_window)

    connect_signal_close_request!(main_window) do self::Window
        destroy!(other_window)
        return WINDOW_CLOSE_REQUEST_RESULT_ALLOW_CLOSE
    end

    present!(main_window)
end

The described issue occurs when using Ubuntu (via wsl). On Windows 10 everything works fine.

Clemapfel commented 7 months ago

I cannot produce this on fedora or windows either. I will try my Ubuntu machine when I work on #80 sometimes this week, thank you for pointing it out.