A focus problem when mouse curse moved on a child-frame in linux

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

A focus problem when mouse curse moved on a child-frame in linux

Feng Shu-2
-------------------------------------------------------
(let ((buffer (get-buffer-create "*test*"))
      (test (let ((after-make-frame-functions nil))
              (make-frame
               `((parent-frame . ,(window-frame))
                 (no-accept-focus . t)
                 (border-width . 0)
                 (internal-border-width . 0)
                 (vertical-scroll-bars . nil)
                 (horizontal-scroll-bars . nil)
                 (left-fringe . 0)
                 (right-fringe . 0)
                 (menu-bar-lines . 0)
                 (tool-bar-lines . 0)
                 (line-spacing . 0)
                 (unsplittable . t)
                 (no-other-frame . t)
                 (undecorated . t)
                 (cursor-type . nil)
                 (minibuffer . nil)
                 (no-special-glyphs . t)
                 (inhibit-double-buffering . t)
                 (width . 10)
                 (height . 10)))))
      (pos (posn-x-y (posn-at-point (point) (selected-window)))))
  (set-window-buffer (frame-root-window test) buffer)
  (set-frame-position test (car pos) (cdr pos))
  (with-current-buffer buffer
    (setq mode-line-format nil)
    (erase-buffer)
    (insert "
--------------------
--------------------
--------------------"))
  (fit-frame-to-buffer test))<I>

-----------------------------------------------------------

1. eval above code at <I> , a child-frame will be at <I>
2. move mouse curse on the top of this child-frame
3. type "a", the "a" should be inserted into the position <I>,
on Windows, it is, but on linux, the "a" is inserted into the
child-frame's buffer instead of position <I>

Reply | Threaded
Open this post in threaded view
|

Re: A focus problem when mouse curse moved on a child-frame in linux

martin rudalics
 > -------------------------------------------------------
 > (let ((buffer (get-buffer-create "*test*"))
 >        (test (let ((after-make-frame-functions nil))
 >                (make-frame
 >                 `((parent-frame . ,(window-frame))
 >                   (no-accept-focus . t)
[...]
 >    (fit-frame-to-buffer test))<I>
 >
 > -----------------------------------------------------------
 >
 > 1. eval above code at <I> , a child-frame will be at <I>
 > 2. move mouse curse on the top of this child-frame

Since the child frame is specified to not accept focus I can't do
that.

 > 3. type "a", the "a" should be inserted into the position <I>,
 > on Windows, it is, but on linux, the "a" is inserted into the
 > child-frame's buffer instead of position <I>

The "a" is inserted at position <I> here (GTK+ Version 3.4.2, xfwm4
under Xfce 4.8 on Debian).  I'm afraid your window manager doesn't
process the 'accept-focus' parameter correctly.

martin

Reply | Threaded
Open this post in threaded view
|

Re: A focus problem when mouse curse moved on a child-frame in linux

Feng Shu-2
martin rudalics <[hidden email]> writes:


> The "a" is inserted at position <I> here (GTK+ Version 3.4.2, xfwm4
> under Xfce 4.8 on Debian).  I'm afraid your window manager doesn't
> process the 'accept-focus' parameter correctly.
>

Indeed, I use EXWM, It seem to be EXWM's bug, I have tested with xfce
too, It works well, thanks for your help :-)


> martin
>

--


Reply | Threaded
Open this post in threaded view
|

Re: A focus problem when mouse curse moved on a child-frame in linux

martin rudalics
 > Indeed, I use EXWM, It seem to be EXWM's bug, I have tested with xfce
 > too, It works well, thanks for your help :-)

Could you try to ask someone or investigate why this does not work in
EXWM?

martin

Reply | Threaded
Open this post in threaded view
|

Re: A focus problem when mouse curse moved on a child-frame in GNU/Linux

Richard Stallman
In reply to this post by Feng Shu-2
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Would you please be so kind as to call the system you're using "GNU/Linux"?

That's what it is.  Calling it "Linux" is simply an error.
We started developing the GNU system in 1984.  Linux is one component
that has been used with GNU since 1992.

The error of calling it "Linux" is important because it has the effect
of attributing our work (of which GNU Emacs is part) to Mr Torvalds
and giving us none of the credit for it.  Please treat us fairly
by calling the system "GNU/Linux".

See https://gnu.org/gnu/linux-and-gnu.html and
https://gnu.org/gnu/gnu-linux-faq.html, plus the history in
https://gnu.org/gnu/the-gnu-project.html.

--
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Skype: No way! See https://stallman.org/skype.html.


Reply | Threaded
Open this post in threaded view
|

Re: A focus problem when mouse curse moved on a child-frame in linux

Feng Shu-2
In reply to this post by martin rudalics
martin rudalics <[hidden email]> writes:

>> Indeed, I use EXWM, It seem to be EXWM's bug, I have tested with xfce
>> too, It works well, thanks for your help :-)
>
> Could you try to ask someone or investigate why this does not work in
> EXWM?
>
I have asked Chris Feng: https://github.com/ch11ng/exwm/issues/350

> martin
>

--


Reply | Threaded
Open this post in threaded view
|

Re: A focus problem when mouse curse moved on a child-frame in linux

martin rudalics
 > I have asked Chris Feng: https://github.com/ch11ng/exwm/issues/350

Thank you.  Please keep me informed if there are any problems.  We
might have to convince him of the usefulness of such an option.

martin

Reply | Threaded
Open this post in threaded view
|

Re: A focus problem when mouse curse moved on a child-frame in linux

Feng Shu-2
martin rudalics <[hidden email]> writes:

>> I have asked Chris Feng: https://github.com/ch11ng/exwm/issues/350
>
> Thank you.  Please keep me informed if there are any problems.  We
> might have to convince him of the usefulness of such an option.
>
> martin

xmonad seem to have the problem too, more details:

https://github.com/tumashu/company-childframe/issues/4#issuecomment-357514918

>

--


Reply | Threaded
Open this post in threaded view
|

Re: A focus problem when mouse curse moved on a child-frame in linux

martin rudalics
 > xmonad seem to have the problem too, more details:
 >
 > https://github.com/tumashu/company-childframe/issues/4#issuecomment-357514918

How do EXWM and Monad react to turning the `no-accept-focus' parameter
on for an arbitrary frame?  That is, if you have two normal frames,
what does

(set-frame-parameter (next-frame) 'no-accept-focus t)

accomplish?  Nothing?

martin

Reply | Threaded
Open this post in threaded view
|

Re: A focus problem when mouse curse moved on a child-frame in linux

Yuri Khan-2
On Mon, Jan 15, 2018 at 4:39 PM, martin rudalics <[hidden email]> wrote:

> How do EXWM and Monad react to turning the `no-accept-focus' parameter
> on for an arbitrary frame?  That is, if you have two normal frames,
> what does
>
> (set-frame-parameter (next-frame) 'no-accept-focus t)
>
> accomplish?  Nothing?

What is the expected behavior for such frames?

On Emacs 26.0.50 under i3wm, if I click in the frame thus modified, it
appears to get focus (i.e. the window manager’s title bar lights up
and the modeline is displayed in the active modeline face), but all
keyboard input goes to the other frame. Am I okay?

Reply | Threaded
Open this post in threaded view
|

Re: A focus problem when mouse curse moved on a child-frame in linux

martin rudalics
 > What is the expected behavior for such frames?

It's difficult to answer that because "focus" is not a well-specified
concept.  Conceptually, such frames should not get selected and not
receive keyboard input.  But they should respond to mouse interaction,
for example, to scroll their windows.

 > On Emacs 26.0.50 under i3wm, if I click in the frame thus modified, it
 > appears to get focus (i.e. the window manager’s title bar lights up
 > and the modeline is displayed in the active modeline face), but all
 > keyboard input goes to the other frame. Am I okay?

Ideally, neither the title bar should light up nor the mode line get
displayed in active modeline face to avoid confusing the user.  But
from what I noticed now in this thread, tiling window manager (EXWM,
xmonad and yours) seem to behave specially.

martin