-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't force an app to not float by config #91
Comments
Maybe you could set Perhaps we should add a predicate variable here to make this possible: https://github.com/emacs-exwm/exwm/blob/master/exwm-manage.el#L402 For the moment, think I would simply advice
But perhaps the exwm-class-name isn't set by the time that code runs? |
You should be able to use (push '((string= exwm-class-name "jetbrains-toolbox") floating nil)) exwm-manage-configurations) |
@Stebalien I've seen code around that uses exwm-manage-configurations, and I'm confused when to use it vs exwm-manage-finish-hook .... Also it doesn't seem documented. |
In general:
Although I'm not entirely sure why your initial code isn't working... |
Question: I've noticed some other annoying behaviors. Are they expected? Firstly, if I open a floating window (jetbrains-toolbox), hide the window, then switch to another workspace, and back again, the floating window comes back. It won't stay hidden. Secondly, if I select a floating window from the buffer menu, it stays hidden. I would have thought that would be the obvious way to bring a hidden window back. Thirdly, when I stop jetbrains toolbox from floating and make it a full frame, I can't switch away from it with say, C-x C-b. No emacs input is accepted. I assume what I'm supposed to do then is s-r (exwm-reset). The trouble is, that makes it float again. why? Fourthly, when I turn off floating (exwm-floating-toggle-floating), and I have say, 4 windows open on the screen, I would have thought it should either grab one of the 4 windows, or else disappear into the buffer list... however what it does in fact is go full screen. So it's impossible to get it into a frame, because after it's full screen, it won't accept emacs input, I have to exwm-reset, and it goes floating again. |
I've never used the "hide floating window" feature (didn't even know it existed). You're right, that looks pretty buggy. Can you file a separate issue for that?
By "a full frame" do you mean Anyways, I'm guessing this is a line-mode/char-mode issue. The window is probably in
By this I assume you mean really full-screen (no mode line, etc.)? Honestly, it sounds like Jetbrains is setting some interesting window properties. Can you use |
You ask what I mean by full frame. I don't know because all I was doing was exwm-floating-toggle-floating. I wasn't aiming for full frame, that's what it forced on me. I would have expected it should either grab a window, or else go away to the buffer list so I could retrieve it to a window. But instead it grabs the whole screen. You suggest exwm-input-grab-keyboard. Difficult, since no emacs keys work at that point. I tried assigning that function to a hot key, but that didn't do anything either. All that did anything was s-r, which is exwm-reset. At that point it floated again. So it was impossible to get it into a window. I can create more issues, how many of the 4 points do you think this warrants? (BTW, are you a maintainer here?) |
I mean:
It sounds like the latter.
One of them, yes.
|
Yes, you're right I can't even see emacs at that point. I have a key mapped to exwm-floating-toggle-floating and it goes full screen such that I can't see emacs, and that's not what I would have expected. |
@Stebalien I tried your suggestion, and put this in my config:
but it didn't work. Puzzled, I put this in to try:
And then nothing floats, including jetbrains-toolbox, which is corect. So it's puzzling why the first code doesn't work. Then I noticed that if I put the first version of the code back, restarted... then started toolbox, killed toolbox, then started it a 2nd time, it worked then! 3rd time works, 4th time works, but 1st time no. So that's strange, I don't know if it's some kind of race condition or what. But it does seem consistent that the 1st time never works. |
I'm not 100% sure, maybe Jetbrains is mapping the window before setting the class name? You'd have to log inside a |
@xpusostomos could that be related to I had similar issues with the Rider, it might solve it for you. |
I have since set _JAVA_AWT_WM_NONREPARENTING, because it was needed to get squirrel-sql to work. I think it might have had some effect. It doesn't grab the whole screen anymore when I turn off floating. However trying to stop floating in the exwm-manage-finish-hook still doesn't work. I haven't got around yet to trying exwm-manage-configurations. However something also got worse, hiding the floating window doesn't seem to work at all. Sometimes it blinks for a fraction of a second, but it doesn't disappear. Hmm.... Hiding a floating Chrome doesn't work either now, so maybe not related to that. Not sure what's going on there. |
I figured out a clue... I noticed the first time I run Toolbox, its class name in the buffer list is "com-jetbrains-toolbox-entry-ToolboxEntry" ... despite xprop saying it is "jetbrains-toolbox" ... on subsequent runs, it correctly is reported as "jetbrains-toolbox". I don't know if the program is changing its window classname early in its startup sequence, or whether there is a bug in exwm. It's certainly odd that the first run is different, and that xprop returns the right thing. If the program was doing something odd, why only the first time? Makes me think exwm is to blame. Anyway I am able to get around it by naming both possibilities...
|
There doesn't seem to be a way to force an app to not float via configuration. I'm using the Jetbrains toolbox app, which apparently sets preferences to float, but I don't want it to.
There are at least 2 issues I see... firstly, there is a function called exwm-floating-toggle-floating. This is not good practice to only have a function that toggles something, rather than having a function which explicitely says true or false to floating... And this leads into the second problem...
If I set a hook to attempt to force it to float...
It doesn't work. I suspect it might be a timing issue in that the slow opening of the window, doesn't give it time to tell it what to do..
The reason I say this, is that jetbrains-toolbox is helpfully coded to only allow one instance to run at once. So if you try and run it twice, it seems to look and see, hey it's already running, and exit.
HOWEVER, the interesting thing is, if you try running a second instance, the existing instance will THEN toggle to a non-floating frame.
Then if you try and run a 3rd time, it will toggle again back to floating, ad infinitum. And that's why I'm guessing that the problem here is one of timing, that exwm is capable of telling the window how to open non-floating, but only if it opens quick enough. That's my guess anyway.
I'm not enough of an emacs guru to know if maybe there's a way to set some kind of timer to force it to do it. However, even if I could do something like that, the issue of the function toggling, rather than asserting what state it wants, is bound to lead to issues again.
I have seen around the web some old code which seemed to use undocumented variables to try and get around the toggling behaviour, but it didn't work for me, and in any case we should have a documented function to set floating positively, rather than toggling.
The text was updated successfully, but these errors were encountered: