[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#36894: Restore frameset focus and selectedness
From: |
Juri Linkov |
Subject: |
bug#36894: Restore frameset focus and selectedness |
Date: |
Wed, 14 Aug 2019 23:50:44 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
>> > The window manager always selects the last created frame, i.e.
>> > it seems it's impossible to create a new frame without selecting it.
>>
>> The xfce window manager has an option for whether a new window should
>> be automatically given focus or not.
>
> I'm not sure I understand what you both are saying. Are you saying
> that this problem is impossible to solve in Emacs?
The problem can be solved with this patch:
diff --git a/lisp/frameset.el b/lisp/frameset.el
index 60b6fe38ad..4f7800630c 100644
--- a/lisp/frameset.el
+++ b/lisp/frameset.el
@@ -1346,6 +1352,16 @@ frameset-restore
(error
(delay-warning 'frameset (error-message-string err) :warning))))))
+ ;; Make sure the last selected frame has focus.
+ (let ((last-focus-frame
+ (catch 'last-focus
+ (maphash (lambda (frame _)
+ (when (frame-parameter frame 'last-focus-update)
+ (throw 'last-focus frame)))
+ frameset--action-map))))
+ (when last-focus-frame
+ (select-frame-set-input-focus last-focus-frame)))
+
;; Make sure there's at least one visible frame.
(unless (or (daemonp)
(catch 'visible
- bug#36894: Stability issues in frameset sorting, (continued)
- bug#36894: Stability issues in frameset sorting, Eli Zaretskii, 2019/08/06
- bug#36894: Stability issues in frameset sorting, Juri Linkov, 2019/08/06
- bug#36894: Stability issues in frameset sorting, Eli Zaretskii, 2019/08/06
- bug#36894: Stability issues in frameset sorting, Juri Linkov, 2019/08/09
- bug#36894: Stability issues in frameset sorting, Eli Zaretskii, 2019/08/09
- bug#36894: Restore frameset focus and selectedness, Juri Linkov, 2019/08/11
- bug#36894: Restore frameset focus and selectedness, Eli Zaretskii, 2019/08/12
- bug#36894: Restore frameset focus and selectedness, Juri Linkov, 2019/08/13
- bug#36894: Restore frameset focus and selectedness, martin rudalics, 2019/08/14
- bug#36894: Restore frameset focus and selectedness, Eli Zaretskii, 2019/08/14
- bug#36894: Restore frameset focus and selectedness,
Juri Linkov <=
- bug#36894: Restore frameset focus and selectedness, martin rudalics, 2019/08/15
- bug#36894: Restore frameset focus and selectedness, Juri Linkov, 2019/08/15
- bug#36894: Restore frameset focus and selectedness, Eli Zaretskii, 2019/08/15
- bug#36894: Restore frameset focus and selectedness, martin rudalics, 2019/08/16
- bug#36894: Restore frameset focus and selectedness, Eli Zaretskii, 2019/08/17
- bug#36894: Restore frameset focus and selectedness, martin rudalics, 2019/08/17
- bug#36894: Restore frameset focus and selectedness, Eli Zaretskii, 2019/08/17
- bug#36894: Restore frameset focus and selectedness, Juri Linkov, 2019/08/17
- bug#36894: Restore frameset focus and selectedness, martin rudalics, 2019/08/19
- bug#36894: Restore frameset focus and selectedness, Juri Linkov, 2019/08/14