telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
25.24k stars 5.01k forks source link

[Feature Request] Fix intentional auto-focus behavior #24909

Open moldabekov opened 1 year ago

moldabekov commented 1 year ago

Is your feature request related to a problem?

If I Cmd+W Telegram, it will obviously close it's window and continue working in a background. If I will open another program, let's say iTerm and quit it with Ctrl+D or Cmd+Q, Telegram will be brought back.

You've already described this behavior in #11807.

Sometimes I want to clear my screen by closing active application to get some files from desktop, but instead of desktop I got Telegram client. Really annoying.

Describe the solution you'd like

I'd like clear and obvious control of windows in my OS. I agree with your position that Cmd+Tab should bring window back, but disagree that it should be brought back automatically when I close another window

Describe alternatives you've considered

Telegram Lite doesn't replicate this behavior and seems to be more comfortable.

Additional context

No response

moldabekov commented 1 year ago

Here is short video demonstration

https://user-images.githubusercontent.com/669547/184301873-72657bae-b7ca-44a5-8bb8-bc098a8da636.mp4

john-preston commented 1 year ago

@moldabekov I need to detect somehow that the app activation happened not because of Cmd+Tab.

Strange thing about Telegram Lite, it is the same codebase as Telegram Desktop.

moldabekov commented 1 year ago

I double checked Telegram Lite, it seems that it behaves identically. My mistake.

Anyway, I beg and urge you to change this behavior :)

moldabekov commented 1 year ago

@john-preston hi there! Is there any news?

john-preston commented 1 year ago

@moldabekov Funny thing that you have native Telegram app in the video (the one from another repository, not this one). This means it behaves the same way as Telegram Desktop even without any code sharing between those apps.

I didn't look for the API difference in Alt+Tab-ing vs Dock-Click-ing yet, sorry. If someone can show me the difference this would speed up the process a lot.

kli0rf commented 1 year ago

I don't see why this issue is labeled as an enhancement. This is obviously a bug. Doesn't happen on windows, doesn't happen on fedora (snap pkg). Only happens on macOS. Is there anyone taking a look into it? Eons have passed since the report...

moldabekov commented 1 year ago

@ilya-fedin @kli0rf I do believe that it is a BUG not a feature request. At the time I was opening this issue I thought that it is kind of feature, but actually this is a bug.

ilya-fedin commented 1 year ago

Well, I don't think you can do anything except of closing this issue and opening a new one with bug report template.

john-preston commented 1 year ago

If I knew on the API side how to activate and show the window when the app is activated by cmd tab and by clicking on the dock icon of already launched app, but not do that when just auto-activating the app because another app had all its windows hidden and lost focus or just was terminated - I'd do it. Right now I don't know how to do that.

kli0rf commented 1 year ago

If I knew on the API side how to activate and show the window when the app is activated by cmd tab...

I believe, the already running app shouldn't be activated and brought back to front by cmd+tab keystroke, if the app was "closed to dock" or even minimized to dock. That's not how it works. Say, you minimize iTerm2, and now you want it back in front - cmd+tab is not how you bring it up. You have to pick the app from the cmt+tab listing, then release the tab and press the option key before releasing cmd, to bring it back up front. The cmd+tab keystroke is not supposed to bring minimized apps. That's why we have cmd+tab+opt for that.

john-preston commented 1 year ago

@kli0rf I think if you choose your app, the messenger, in the Cmd Tab list and just nothing happens, as if you didn’t choose it at all, it looks like a bug.

kli0rf commented 1 year ago

@john-preston But that's exactly how macOS works, if we're talking about minimized, and not just unfocused apps. So Apple disagrees. If the app's minimized, you gotta hit option key additionally, to bring it back up front. That's the intented behaviour.

john-preston commented 1 year ago

Funny thing, for me it worked the same way (without activating the window) if the window was minimized. But it activated the window if it was closed by 'x' before Cmd+Tabbing to it.

thannaske commented 1 year ago

Is ever going to happen something in regards of the "Feature" Request (which is obviously a bug)?

There are multiple bug reports out there, my most favourite comment from a repository maintainer must be this one here:

Topic-wise, it's a duplicate. You can't open a bug as long as the feature request is open. Sorry.

Well then go ahead, close this "feature" request because it isn't one and maybe start taking this bug seriously?

kli0rf commented 1 year ago

Not that i think it would make any difference, but i agree completely. @moldabekov, could you please close this 'feature request' so you or someone else can resubmit this as a bug report, which it certainly is?

ilya-fedin commented 1 year ago

Is ever going to happen something in regards of the "Feature" Request (which is obviously a bug)?

According to https://github.com/telegramdesktop/tdesktop/issues/24909#issuecomment-1556212414, no, it's unlikely there will be a progress. You have to get used to the behavior.

kli0rf commented 1 year ago

Is ever going to happen something in regards of the "Feature" Request (which is obviously a bug)?

According to #24909 (comment), no, it's unlikely there will be a progress. You have to get used to the behavior.

I hope you're wrong. And even if you're not, i think it's for the best to call the things what they are. And this is a bug and not lack of some feature. BTW, adding "start minimized" to macOS' tdesktop would be a nice thing to do, but that's another topic. And probably a feature. Or maybe not, 'cause it's only missing on macOS. :)

ilya-fedin commented 1 year ago

And this is a bug and not lack of some feature.

Well, it's not a bug if this is intended. And according to @john-preston, this is intended decision due to the lack of APIs from the system.

ilya-fedin commented 1 year ago

In other words, if this feature request will be closed and one opens a bug report, it may be closed as intended behavior. So I suggest to not to move :D

kli0rf commented 1 year ago

And this is a bug and not lack of some feature.

Well, it's not a bug if this is intended. And according to @john-preston, this is intended decision due to the lack of APIs from the system.

I believe @john-preston is wrong. I explained the "whys" and the "hows" few comments above, and it's not just me who disagrees with him, Apple disagrees as well.

BTW, my tdeskop for macOS comes NOT from the store. :)

ilya-fedin commented 1 year ago

Well, he makes decisions here, not Apple ;)

kli0rf commented 1 year ago

image

Well, if we're able to gather more people stating the obvious, perhaps there's a chance we can change his mind. :)

thannaske commented 1 year ago

And this is a bug and not lack of some feature.

Well, it's not a bug if this is intended. And according to @john-preston, this is intended decision due to the lack of APIs from the system.

Please excuse my wording, but I hope that's a joke because if that would be true how comes it that virtually no other application on macOS (neither background nor foreground, neither chat nor "other" application) is showing that very behavior.

This bug effectively doubles the amount of clicks I need to take to close down foreground applications because everytime I closed one, Telegram pops up and I can close it as well. And I can't even CMD-Q it because it obviously needs to continue to run.

I understand that this is an open source project and everybody can work on it and the issue section of GitHub is most definitely the wrong place to talk down other people's work. But it certainly annoys me how this application behavior is just labeled as "not a bug and basically you have to deal with it" when it most certainly is a bug.

kli0rf commented 1 year ago

But it certainly annoys me how this application behavior is just labeled as "not a bug and basically you have to deal with it" when it most certainly is a bug.

Well, let's call it "the intented bug". :)

ilya-fedin commented 1 year ago

Well, there are three things you can do, like you that or not:

  1. Get used to this behavior
  2. Create a fork
  3. Fight with Apple, find undocumented API or etc, etc, etc to get rid of this accepted tradeoff yet still having that:

    activate and show the window when the app is activated by cmd tab and by clicking on the dock icon of already launched app

Note that if tdesktop wasn't open source you likely had only option №1.

when it most certainly is a bug

Correction: It's just a behavior you don't like. For behavior to become a bug, it must be unintended. This behavior is intended as a tradeoff for other behavior to work as expected (from dev PoV).

Well, let's call it "the intented bug". :)

Or rather just "bad UX" :)

kli0rf commented 1 year ago
  1. Get used to this behavior

One doesn't ever get used to the pebble in the shoe. At least i don't have to use macOS everyday. :)

Alritey, you might have a point why this is not a bug. However, this is a flaw. But if @john-preston is the only one making the decisions on the subject, then i suppose there's no point of relabeling the issue, as it wouldn't change anything. Let's just hope more users come here and help to change his mind.

athousanddetails commented 6 months ago

this is a bug and annoying as hell. No other app on Mac OS X behaves like this.

Fix it Dev.

kli0rf commented 6 months ago

I don't use telegram on macos anymore just because of this. Just started to use telegram-web, if i really need it on macbook. Actually telegram-web became pretty decent, it's totally usable. And this fork of telegram is on it's way to become an abandonware, so just move to telegram-web.

thennothinghappened commented 3 months ago

This is something that bugs me pretty constantly. Pretty much half the time I close something Telegram pops up, meaning I have to press Cmd+W twice instead of once. Big issue? Not really, but its annoying nonetheless and quite clearly not how any other application works on MacOS.

The expectation of how windows work under MacOS is that applications may have any number (or zero) windows open at a time and still be running - there's no tie between a window existing an the application being open with a dot beneath in the dock. There's a much stronger tie between having a window and being open on say Windows (not discounting background applications or tray apps though). On clicking an open app in the dock, the app will instantiate a new window if none are open, or will focus the first one of its choice if there's multiple.

On the other hand, Using Cmd+Tab to select an app differs from this - the windowless app will be set to focus, but no window will be opened if none currently exist: the user needs to hit Cmd+T to create one. This is consistent across other applications except Telegram.

Telegram seems to have implemented an intentionally incorrect behaviour by merging the effect of Cmd+Tab selection and dock selection. Presumably (I haven't checked the APIs) the event for being focused by Cmd+Tab, and being focused by the handoff to the next app if the current foreground one is closed, is the same. Thus, Telegram will also open when brought to the foreground by either method; neither of which is correct, where one is a patch over a mild inconvenience - in the form of not liking how the OS and all other apps do it - and the unintended side effect of doing so is a far more annoying issue.

As far as I can see, this isn't really a feature request, the fact that Telegram does an incorrect behaviour (where the fact it opens a new window whatsoever on Cmd+Tab instead of waiting for a Cmd+T is incorrect as well) is a bug. An intentionally introduced one, but a bug nonetheless.