stretchly icon indicating copy to clipboard operation
stretchly copied to clipboard

Full screen applications disable Stretchly

Open aidanmischke opened this issue 7 years ago • 29 comments

I would prefer not to receive break notifications when running full screen applications as break notifications cause the full screen application to minimize.

When I play games or run other full screen applications it would be great if Stretchly could set itself to do not disturb or disable itself.

When the full screen application is closed, Stretchly would revert to its previous state and act as per usual.

Ideally this feature could be toggled in the settings section.

aidanmischke avatar Jan 11 '19 22:01 aidanmischke

I was coming to write about same thing, but I am suggesting diffrent thing. I used to use app called EyeLeo and it used notifications that came in while gaming, but it did not crash the games like this does. Eyeleo somehow shows notifications over game without it losing the full screen mode. If that cannot be done I would like that there would be some way that the app would keep record how many pauses was skipped and force to keep them all in row before can continue.

Would be superior if someone would have skills to make this somehow do something with philips hue. Like while gaming there would be no notifications, but philips hue lights would turn to some other color for break and then turn back normal when break is kept.

Matsku12 avatar Jan 12 '19 10:01 Matsku12

AFAIK there is no way for electron/nodejs apps to check whether some other app is fullscreen ;/

Another problem would be telling when to ignore fullscreen and when not. Ie while gaming it might make sense, but with fullscreen browser probably not.

I think the easiest way is to simply pause/resume stretchly manually.

hovancik avatar Jan 13 '19 14:01 hovancik

I use these programs mainly for gaming. Eyeleo and this. Both have one "dealbreaker" which makes them unusable for me :/ in eyeleo its afk recognition and with this the problem with breaking full screen.

Would it be possible to add some setting for that? I´d rather would turn this manually off when watching video or such and keep on while gaming. Could you add "ignore fullscreen" setting and problems would be solved? I think it would help people that games a lot and I think most people have the issues with keeping breaks while gaming.

Matsku12 avatar Jan 13 '19 14:01 Matsku12

Unfortunately, the problem is that I know of no way for me to see if other apps are in fullscreen ;/

hovancik avatar Jan 14 '19 18:01 hovancik

What if you make it work allways at the top no matter is or is there not some app in fullscreen?

Matsku12 avatar Jan 14 '19 18:01 Matsku12

stretchly is set to be always on top https://github.com/hovancik/stretchly/blob/master/app/main.js#L308

I guess those other apps manage to get even more on top somehow. I would be lying if I tell I understand how that works

hovancik avatar Jan 26 '19 13:01 hovancik

I found this which describes a way of detecting if other apps are full screen: https://www.richard-banks.org/2007/09/how-to-detect-if-another-application-is.html

PonyoStar avatar Feb 06 '19 12:02 PonyoStar

Unfortunately that's not for NodeJS ;/

hovancik avatar Feb 10 '19 17:02 hovancik

@hovancik Would either of these Stack Overflow answers be of any use?

I always end up forgetting to disable stretchly when playing games, it can be quite frustrating with "don't let me skip breaks" enabled. Which just leads to me allowing skipable breaks or not using stretchly as much. 😕

User486375 avatar Mar 09 '19 16:03 User486375

Unless it's easy to use electron or nodejs module, then it's kinda impossible (with my level of skills, as they talk about C debugging). I would need to know which apps are running in what mode and then user would have to setup which apps are to be ignored and which ones not. (eg for games it makes sense to shut stretchly, but it's different use-case for Word, browser or some other work tool)

hovancik avatar Mar 11 '19 14:03 hovancik

@hovancik I'm just wondering how exactly does the monitor Do Not Distrub feature work on windows 10 if at all? I noticed it doesn't seem to have anything to do with focus assist and I don't see what else it could be. I was thinking how if it was possible to track focus assist status with electron that would be very useful as focus assist can already detect if you're in a game, have custom set times and in the upcoming update this month detect full screen applications.

User486375 avatar May 06 '19 03:05 User486375

@User486375 I'm using this package: https://github.com/felixrieseberg/electron-notification-state#windows

hovancik avatar May 07 '19 16:05 hovancik

@hovancik there is a reported issue from last year with that package...https://github.com/felixrieseberg/electron-notification-state/issues/4

So do not disturb (or Focus Assist) in windows settings is not taken into consideration :(

This just stung me during a customer presentation, where i put my laptop into Focus Assist to prevent all notifications, and streachly filled the screen...now i need to remember to also set Strechly as paused.

BlythMeister avatar May 16 '19 09:05 BlythMeister

Too bad ;/

hovancik avatar May 16 '19 11:05 hovancik

Hi all, I am closing this in favor of #389 where possible functionality (have a list of apps that would "pause" stretchly) is being discussed. It's not totally the same, but I think I wont be able to check for fullscreen apps

hovancik avatar Oct 11 '19 10:10 hovancik

@hovancik Pausing on fullscreen would be a simple enough checkbox to include in the exclusions interface, and I don't think the implementation would be untenable either. I'm afraid I'm not a skilled enough programmer to try to to implement this myself, but I know there's a number of ways. Another open-source wellbeing app, Lightbulb, adjusts behavior when an app is fullscreen, and I know there's a number of ways to do it in various languages, like this one in Javascript. The simplest method would be to compare window height to screen height (and consider the app to be fullscreen if it's within a margin of error, corresponding to the height of the taskbar and/or statusbar). This might not work perfectly for multi-monitor setups, but it would be a start.

Pausing on fullscreen is an important feature for a lot of people, though. For example, I want Stretchly running while I'm doing casual internet browsing, but if I'm watching a video in my browser and have it fullscreen, I don't want to be interrupted. Same thing for when I'm video chatting (either in-browser or in an app like Zoom). If the window is fullscreen, I probably care about it enough that I'd like Stretchly not to interrupt.

e-t-l avatar May 09 '21 03:05 e-t-l

+1 for pausing (not resetting/restarting the timer) while on full-screen mode, if possible of course. I tried relying on W10's Focus Assist/DND mode but it is totally unreliable, e.g. engaging when running unrelated, non-full screen programs etc.

Gittyperson avatar May 11 '21 11:05 Gittyperson

Looks like Lightbulb uses this (which, in addition to calling the fullscreen check, also calls the list of active applications, and active window, which could be handy. The current implementation of Exclusions in #389 will pause Stretchly when those applications are running at all, not necessarily when they're the active window, which would make more sense.) It calls these, which it looks like actually do the communicating with the Windows system.

Of course, all this is written in C#, and while I know there's ways to embed other languages in JS, I simply don't know if it's possible with Electron or how to do it. I'm happy to try to find out more, but it would be nice if a contributor with a bit more experience than me in either language could help me out.

Would you at least be open to reconsidering this feature?

e-t-l avatar May 11 '21 12:05 e-t-l

there's a number of ways to do it in various languages, like this one in Javascript

That's for a browser itself, as in: I can check that browser that I run this script in, is fullscreen; not for another apps running on the system.

But yeah, sure, if there a cross-platform way how to detect if there is a fullscreen app running in Electron, I will be glad to add it. When I did my research, I was not able to find anything.

hovancik avatar May 16 '21 14:05 hovancik

@hovancik This is an imperfect solution, but comparing screen.height === screen.availHeight && screen.width === screen.availWidth would return whether the taskbar is visible. So the Stretchly setting wouldn't be, "Pause when fullscreen," but rather, "Pause when Taskbar is hidden." Thoughts?

e-t-l avatar Jan 29 '22 16:01 e-t-l

That would fix the problem completely at least on my part


From: e-t-l @.> Sent: Saturday, January 29, 2022 6:30:53 PM To: hovancik/stretchly @.> Cc: Matsku12 @.>; Comment @.> Subject: Re: [hovancik/stretchly] Full screen applications disable Stretchly (#355)

@hovancikhttps://github.com/hovancik This is an imperfect solution, but comparing screen.height === screen.availHeight && screen.width === screen.availWidth would return whether the taskbar is visible. So the Stretchly setting wouldn't be, "Pause when fullscreen," but rather, "Pause when Taskbar is hidden." Thoughts?

— Reply to this email directly, view it on GitHubhttps://github.com/hovancik/stretchly/issues/355#issuecomment-1024942752, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC62BWZPNY2J7AZGW2R56J3UYQI33ANCNFSM4GPRDLDA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.Message ID: @.***>

Matsku12 avatar Jan 29 '22 17:01 Matsku12

@e-t-l have you tried it?

hovancik avatar Feb 21 '22 14:02 hovancik

Are you asking if I've built Fetchly from source with the added javascript to test the screen dimensions? No, I haven't.

-- edited for typo

e-t-l avatar Feb 21 '22 22:02 e-t-l

@hovancik can this work? https://www.npmjs.com/package/detect-fullscreen

soredake avatar Mar 05 '23 08:03 soredake

@soredake I guess we will need to try :) too bad it does not support linux, it's my main machine.

Would be nice if someone would try that, I am very low on time.

Notes:

Currently we have:

    {
        "rule": "pause",
        "active": true,
        "commands": [
            "/usr/share/skypeforlinux/skypeforlinux",
            "atom"
        ]
    }
]

I think we could extend that by adding some special value like0-fullscreen that would mean we wanna check if there is any fullscreen window

"appExclusions": [
    {
        "rule": "pause",
        "active": true,
        "commands": [
            "/usr/share/skypeforlinux/skypeforlinux",
            "atom",
            "0-fullscreen"
        ]
    }
]

hovancik avatar Mar 18 '23 12:03 hovancik