Clemapfel / Mousetrap.jl

Finally, a GUI Engine made for Julia

Home Page:https://clemens-cords.com/mousetrap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hide on close for windows is broken ?

MichaelSchloesser opened this issue · comments

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.

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.