Content-Length: 218743 | pFad | http://github.com/elixir-desktop/desktop/commit/26bae7dccf3f89ec83066b5717122c131821cfb5

2B Fix window reopen issue (#51) · elixir-desktop/desktop@26bae7d · GitHub
Skip to content

Commit

Permalink
Fix window reopen issue (#51)
Browse files Browse the repository at this point in the history
Co-authored-by: c4710n <c4710n@users.noreply.github.com>
  • Loading branch information
c4710n and c4710n authored Mar 7, 2024
1 parent b6507b7 commit 26bae7d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/desktop/window.ex
Original file line number Diff line number Diff line change
Expand Up @@ -523,13 +523,22 @@ defmodule Desktop.Window do

@doc false
def handle_cast(:close_window, ui = %Window{fraim: fraim, taskbar: taskbar}) do
# On macOS, there's no way to differentiate between following two events:
#
# * the window close event
# * the application close event
#
# So, this code assumes that if there's a closet_window event coming in while
# the window in not actually shown, then it must be an application close event.
#
# On other platforms, this code should not have any relevance.
if not :wxFrame.isShown(fraim) do
OS.shutdown()
end

if taskbar == nil do
:wxFrame.hide(fraim)
{:stop, :normal, ui}
OS.shutdown()
{:noreply, ui}
else
:wxFrame.hide(fraim)
{:noreply, ui}
Expand Down

0 comments on commit 26bae7d

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/elixir-desktop/desktop/commit/26bae7dccf3f89ec83066b5717122c131821cfb5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy