wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.34k stars 1.22k forks source link

Do not open window automatically #2550

Closed Laeri closed 12 months ago

Laeri commented 1 year ago

Is your feature request related to a problem? Please describe.

My problem is that when using wails dev after every recompilation the application window will automatically open in the current workspace again. This is problematic because I use a tiling window manager and the wails application window will not stay in the assigned workspace but lead to a splitted layout in the current workspace. That really hinders productivity and is quite annoying as my IDE which is full screen will be assigned to half of the window.

Either the window should stay in the assigned workspace which I think is probably not possible to implement as this is specific to each window manager or do not open any window and let the user o navigate to localhost:34115 where it is served.

In addition, sometimes I need to have the browser window open to gain access to the developer console in the browser. If a change leads to a recompilation both windows will be reloaded which can lead to race conditions when doing any changes to config files saved due to two applications simultaneously changing these.

Describe the solution you'd like

Having an option that no window is opened and let the user navigate to localhost:34115 themselves would solve both problems.

Describe alternatives you've considered

No response

Additional context

No response

Laeri commented 1 year ago

In case anyone is using hyprland as a window manager you can configure rules that restrict windows to workspaces and do not let them take focus which solves the first problem in my case in the config file ~/.config/hypr/hyprland.conf:

windowrulev2 = workspace 7 silent,nofullscreenrequest,class:^(<YOUR_CLASS>),title:^(<YOUR_TITLE>)

However, the problem with race condition of two open applications still exists.

Darkslategray-lgtm commented 1 year ago

Same question.I've had this problem since I started using it, and have yet to find out how to turn off this annoying feature

leaanthony commented 1 year ago

Did you try this? https://wails.io/docs/next/reference/options/#starthidden

BenoitBotton commented 12 months ago

@leaanthony , I tried it and it works for me , on win11. great to have only the browser window so I can use the vue devtools.

now off to see how I can programmatically switch it on/off for dev/prod

leaanthony commented 12 months ago

Cool. I think this can be closed now