-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Resubmit #128 (X.H.Focus) #192
Conversation
@sgf-dma works as expected, I just updated to last commit without any changes in my config code: |
@unclechu Thanks. But after looking into your config i can't find where you're enabling window activation? Does window activation works at all in your config? If you use Starting from commit 8278cf6 (which was in previous version too; the commit, where |
@sgf-dma I have everything about focus-hook here.
Maybe I misunderstand something, what do you mean by "managing focus of NOT new windows"? What I actually need (and already got) is:
|
I mean, that window may be either new or activated using
I test window activation with running
Also, take note, that:
|
@sgf-dma Sometimes I'm having a bug with this hook, when I have started some application and opened This bug triggered not by any application. For example by any electron-based application or by starting |
Yes, there is such bug. But, if we're talking about the same thing, this is a
open a terminal (i use And the fix for this is to enable window activation, i.e. to call
with this config input focus will not be grabbed by activated window. Note, that after my PR window activation by default will do nothing, so you may safely I can't run your config without some removals (i've installed only xmonad
Please, try this and if this fixes your config, i'll submit a separate bug |
On Sun, Jun 25, 2017 at 11:45 AM, sgf-dma ***@***.***> wrote:
open a terminal (i use xterm) and firefox window at the same workspace,
and
then run firefox google.ru in the terminal. This triggers activation of
firefox window and input focus will switch to firefox, but window focus
(red
border) will remain on terminal. Running refresh will fix input focus
(return back to terminal).
And the fix for this is to enable window activation, i.e. to call ewmh
function:
Firefox back to violating ICCCM again? Figures. We're back to needing a way
to lie about EWMH support again, then, to stop this crap.
Briefly: firefox is saying "oh, the WM isn't advertising EWMH, I'll just
forcibly steal the focus for myself because I feel like it". We don't
handle that well because programs are not supposed to do it, and
justifiably the correct response is not to update the border but to switch
the focus back to where the user had it in the first place.
…--
brandon s allbery kf8nh sine nomine associates
allbery.b@gmail.com ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
|
@sgf-dma by adding |
@sgf-dma oh, I just realized that now when I open some link for example by running command |
I've glanced over changes you've made in your config.. well, removing
Of course, you can. It's doing exactly what you've asked it to:
Essentially, if a window in the list is focused on workspace, where activated
which is equal to just
Before enabling
or make something different with activated window, e.g. move it to current
See module description for more details and full example. |
I didn't remove it, I just moved it to separate module. |
@sgf-dma sorry, I just totally forgot about I have this exactly feature described in my config, just because it haven't work before I add |
Sorry for being utterly late to the party. Your module seems reasonable, the documentation is thorough. I didn't get to test everything, but my test cases
were easy to implement and worked like a charm. |
cb5ce00
to
3426d24
Compare
@byorgey @ivanbrennan @geekosaur Can we finally merge this? Or someone still has questions about this module behavior? |
@sgf-dma I don't see why not. Would you mind taking a look at the merge conflicts? |
- By default window activation does nothing. - `activateLogHook` may be used for running some 'ManageHook' for activated window. - `activated` predicate may be used for checking was window activated or not.
Extend ManageHook EDSL to work on focused windows and current workspace.
Rebased. Please, review. |
Thanks! |
I guess I'm later to the party than everyone else, and I'm sorry (my excuse being that I had a working version of this in #110 so I didn't have the motivation to fix what already worked, but now that it's merged I need to adapt my config so I'm forced to look at this). Why does this invoke the global Furthemore, there's one little bit missing in this that's solved in #110: differentiating between windows asking to be activated and pagers (alttab, rofi, …) requesting that a window is activated. See https://github.com/xmonad/xmonad-contrib/pull/110/files#diff-cf9308345d1d5de4c1e403c5874d91d723ffc5d4ff79b21c4dbfe6390a592598R236. This bit will need to be fixed before I can switch over to this. Let me know what you folks think. I can implement any or all of this, but we should first agree if these changes are desired or whether you're all happy with the current design. I'm Liskni_si in #xmonad@freenode if you wish to discuss this more interactively. |
Related: xmonad#396 Related: xmonad#399 Related: xmonad#192
…gnored This makes window switching apps like rofi and alttab able to activate windows even if the logHook doesn't activate them (which it doesn't by default, and that's a regression). Fixes: 45052b9 ("X.H.EwmhDesktops. run 'logHook' for activated window.") Related: xmonad#396 Related: xmonad#110 Related: xmonad#192
These are useful when one blocks some _NET_ACTIVE_WINDOW requests but still wants to somehow show that a window requested focus. Related: xmonad#110 Related: xmonad#128 Related: xmonad#192
These are useful when one blocks some _NET_ACTIVE_WINDOW requests but still wants to somehow show that a window requested focus. Related: xmonad#110 Related: xmonad#128 Related: xmonad#192
These are useful when one blocks some _NET_ACTIVE_WINDOW requests but still wants to somehow show that a window requested focus. Related: xmonad#110 Related: xmonad#128 Related: xmonad#192
TODO Fixes: xmonad#396 Related: xmonad#110 Related: xmonad#192 Related: xmonad#128
These are useful when one blocks some _NET_ACTIVE_WINDOW requests but still wants to somehow show that a window requested focus. Related: xmonad#110 Related: xmonad#128 Related: xmonad#192
xmonad#192 introduced a breaking change: * `XMonad.Hooks.EwmhDesktops`   `ewmh` function will use `logHook` for handling activated window. And now  by default window activation will do nothing. This breaking change can be avoided if we designed that a bit differently. xmonad#192 changed `ewmhDesktopsEventHook` to invoke `logHook` instead of focusing the window that requested activation and now `logHook` is supposed to invoke a `ManageHook` through `activateLogHook` which consults a global `NetActivated` extensible state to tell if it's being invoked from `ewmhDesktopsEventHook`. This seems convoluted to me. A better design, in my opinion, is to invoke the `ManageHook` directly from `ewmhDesktopsEventHook`, and we just need a way to configure the hook. Luckily, we now have `X.U.ExtensibleConf` which makes this straightforward. So we now have a `setEwmhActivateHook`, and the activation hook defaults to focusing the window, undoing the breaking change. Fixes: xmonad#396 Related: xmonad#110 Related: xmonad#192 Related: xmonad#128
xmonad#192 introduced a breaking change: * `XMonad.Hooks.EwmhDesktops`   `ewmh` function will use `logHook` for handling activated window. And now  by default window activation will do nothing. This breaking change can be avoided if we designed that a bit differently. xmonad#192 changed `ewmhDesktopsEventHook` to invoke `logHook` instead of focusing the window that requested activation and now `logHook` is supposed to invoke a `ManageHook` through `activateLogHook` which consults a global `NetActivated` extensible state to tell if it's being invoked from `ewmhDesktopsEventHook`. This seems convoluted to me. A better design, in my opinion, is to invoke the `ManageHook` directly from `ewmhDesktopsEventHook`, and we just need a way to configure the hook. Luckily, we now have `X.U.ExtensibleConf` which makes this straightforward. So we now have a `setEwmhActivateHook`, and the activation hook defaults to focusing the window, undoing the breaking change. Fixes: xmonad#396 Related: xmonad#110 Related: xmonad#192 Related: xmonad#128
Fixes: xmonad#396 Related: xmonad#192 Related: xmonad#128
xmonad#192 introduced a breaking change: * `XMonad.Hooks.EwmhDesktops`   `ewmh` function will use `logHook` for handling activated window. And now  by default window activation will do nothing. This breaking change can be avoided if we designed that a bit differently. xmonad#192 changed `ewmhDesktopsEventHook` to invoke `logHook` instead of focusing the window that requested activation and now `logHook` is supposed to invoke a `ManageHook` through `activateLogHook` which consults a global `NetActivated` extensible state to tell if it's being invoked from `ewmhDesktopsEventHook`. This seems convoluted to me. A better design, in my opinion, is to invoke the `ManageHook` directly from `ewmhDesktopsEventHook`, and we just need a way to configure the hook. Luckily, we now have `X.U.ExtensibleConf` which makes this straightforward. So we now have a `setEwmhActivateHook`, and the activation hook defaults to focusing the window, undoing the breaking change. Fixes: xmonad#396 Related: xmonad#110 Related: xmonad#192 Related: xmonad#128
Fixes: xmonad#396 Related: xmonad#192 Related: xmonad#128
These are useful when one blocks some _NET_ACTIVE_WINDOW requests but still wants to somehow show that a window requested focus. Related: xmonad#110 Related: xmonad#128 Related: xmonad#192
xmonad#192 introduced a breaking change: * `XMonad.Hooks.EwmhDesktops`   `ewmh` function will use `logHook` for handling activated window. And now  by default window activation will do nothing. This breaking change can be avoided if we designed that a bit differently. xmonad#192 changed `ewmhDesktopsEventHook` to invoke `logHook` instead of focusing the window that requested activation and now `logHook` is supposed to invoke a `ManageHook` through `activateLogHook` which consults a global `NetActivated` extensible state to tell if it's being invoked from `ewmhDesktopsEventHook`. This seems convoluted to me. A better design, in my opinion, is to invoke the `ManageHook` directly from `ewmhDesktopsEventHook`, and we just need a way to configure the hook. Luckily, we now have `X.U.ExtensibleConf` which makes this straightforward. So we now have a `setEwmhActivateHook`, and the activation hook defaults to focusing the window, undoing the breaking change. Fixes: xmonad#396 Related: xmonad#110 Related: xmonad#192 Related: xmonad#128
Fixes: xmonad#396 Related: xmonad#192 Related: xmonad#128
Resubmit #128 with changes requested in #162 .
@pjones , @geekosaur Please, test and review.
@SirBoonami , @unclechu Please, try updated version. Now
logHook
(instead ofmanageHook
) runs for activated window. Thus, if you use this module for managing focus only for activated windows, you need to addFocusHook
to yourlogHook
. E.g.If you use
FocusHook
for managing focus for both new and activated windows, you need to add it to both. Either create two differentFocusHook
-s, e.g.:or (as was before) use the single
FocusHook
withactivated
predicate, e.g.:See description for more examples and details.
Checklist
I've read CONTRIBUTING.md
I tested my changes with xmonad-testing
I updated the
CHANGES.md
file