pomatez icon indicating copy to clipboard operation
pomatez copied to clipboard

Fullscreen break on multiple monitors

Open Hydro8 opened this issue 4 years ago • 17 comments

Hi

I have three screens at my work. Is it possible to have a setting to choose if break screen take only one screen or every screens ? Or is it too much ?

Thank !

Hydro8 avatar Jun 22 '20 08:06 Hydro8

Is it occupying the whole three screens on break?

roldanjr avatar Jun 22 '20 08:06 roldanjr

The timer is on the right screen :

image

So the break is full screen for the right screen :

image

What will be awesome is to be able to have full screen break on all screen and the timer on middle screen. Don't know if it's possible and easy to implement ?

Hydro8 avatar Jun 22 '20 12:06 Hydro8

It's really hard to tell. I think it is possible to occupy all screen but programmatically setting the timer on the middle of the all the screens is not doable.

roldanjr avatar Jun 22 '20 12:06 roldanjr

@sekwah41 do you use multiple screens? Maybe you could help us if you do.

Here I found Electron Screen API but I can't implement it because I only used one.

Maybe you have an idea too? Thank you.

roldanjr avatar Jun 23 '20 05:06 roldanjr

Yea ive got 4 :)

The best method I can think of for this as its a react application would be to use the timer component and make x number of windows for the extra screens and figure out which one the application is currently on.

Or a more robust method would be to not turn the normal program into one of the windows and open new timeout timers over all the screens which are communicated with via sending messages over the ipc rather than having a timer for every single one.

As long as you move the window within the display before full screening it then it should go to the right display :)

Ive got a lot of projects to work on atm though I can take a look at it when I get a moment.

sekwah41 avatar Jun 23 '20 08:06 sekwah41

The easiest way to achieve this would be to add a second router that can swap out the whole page with one that is only a timer for breaks and add timer pulses to the ipc. The new approach would be fine to use even in single desktop mode if wanted and would just replace the code for the fullscreen event.

I'm still learning react so it may be a bit fiddly or may need some cleanup from you. I'll see if I get any time tonight to try to make it.

sekwah41 avatar Jun 23 '20 11:06 sekwah41

Thanks for the effort @sekwah41 .

roldanjr avatar Jun 23 '20 11:06 roldanjr

Sorry that ive vanished on this. I was relatively new to react and have been balancing my job and some personal work.

So the best way I thought of doing this was to make a new page on the top-level router and use that for the extra displays to be made for the other screens. Ive partially implemented it but when I get some time I'll try to finish it off :)

sekwah41 avatar Aug 20 '20 20:08 sekwah41

No worries @sekwah41 . It's okay I understand.

By the way, I've restructured the app architecture to be more future proof.

I need to change it to a monorepo style using Lerna and Yarn Workspaces so that there's a clear separation of concerns between renderer and main process and also makes it easier for code sharing between those processes.

Please check it out as soon as you can. Thank you friend.

roldanjr avatar Aug 21 '20 02:08 roldanjr

Hello, I think that not taking all screens somewhat breaks the purpose of full screen breaks.

For example, if I'm doing web development I usually have several open apps spread around all available screens, which in break time translates to my main window (editor, terminal) "having a break " but all remaining screens showing the web browser, developer tools pane, etc.

diegonz avatar Dec 15 '20 10:12 diegonz

I will take a look into this once we've merged the currently outstanding PR's. It's also been raised more recently as part of #207 and #180.

I've ended up writing some of my own apps since this issue was originally raised and have a better understanding of electron so likely can get it all sorted this time. Just need to schedule the time between my other projects though if anyone else wants to pick it up before I get to it they are more than welcome :heart:

sekwah41 avatar Feb 25 '22 21:02 sekwah41

I've also pinned the issue as it's been opened a few times more and it's quite an old one.

sekwah41 avatar Feb 25 '22 21:02 sekwah41

We are looking to switch platforms to Tauri but it seems the Linux targets are a bit limited. So I will take a look at getting it working hopefully on electron first. I mean if we just make sure it's calling a generic function of fullscreen break whatever backend system is running can handle that in its own way.

sekwah41 avatar Dec 21 '22 15:12 sekwah41

Hello, do you have news on this issue?

LeonPyramid avatar Dec 12 '23 10:12 LeonPyramid

Atm I am planning to focus on the Tauri version so I am planning to re-visit this once we've got that fully replacing Electron or mostly replacing.

sekwah41 avatar Dec 12 '23 10:12 sekwah41

While I'm not a Tauri developer, Pomatez only calls Tauri's API:

https://github.com/zidoro/pomatez/blob/a2e93d5ea7b289746ea596a5d3cf20e26f573ba7/app/electron/src/lifecycleEventHandlers/fullScreenBreak.ts#L24-L41

https://tauri.app/v1/api/js/window/#setfullscreen

And I can't find any issue about "multiple monitors" 'displays' or 'screens' e.g. https://github.com/search?q=repo%3Atauri-apps%2Ftauri+multiple+fullscreen&type=issues

I believe they need to implement that first that first so that API can be used here.

gianpaj avatar Mar 07 '24 07:03 gianpaj

@gianpaj i'm not had a chance to take a look at this lately and other tasks have taken priority however it wouldn't be just Tauri that needs to implement this. Basically if it supports multiple windows we can get the screen locations and other data another way.

Also we'd need to implement it for both electron and Tauri unless I focused on making the electron version obsolete.

sekwah41 avatar Mar 07 '24 09:03 sekwah41