Re: Is it possible to catch ALT+TAB and do nothing

2018-05-07 Thread James Cameron
On Mon, May 07, 2018 at 04:27:57PM -0500, Igor Korot wrote:
> Paul et al,
> Any idea how to configure FVWM to not to give focus to xterm if one
> specific window is displayed?

You might ask on an fvwm mailing list, but fvwm does have a
NeverFocus method that can be applied to an application such as xterm.

http://www.fvwm.org/documentation/manpages/fvwm.html

But that would just fix your problem for xterm; to enforce focus for a
lock screen, there's more to do.  Have a look at the code for other
lock screens to find out what that is.

Briefly, make a global mouse and keyboard grab, subscribe to window
visibility events, and when they occur raise the window above whatever
was stacked on top of it.

You could also adjust xterm sources to ask for focus skip; bit 0 of
_WIN_HINTS property.

> 
> I tried:
> 
> [code]
> Key  Tab A M WindowList("!xterm")
> [/code]
> 
> but it doesn't work.
> 
> Thank you.
> 
> 
> On Mon, May 7, 2018 at 12:44 PM, Paul Davis  
> wrote:
> > the window manager can intervene to catch more or less any key combinations
> > the user has told it to be interested in. if the user told it use Alt-Tab
> > for focus switching, it will catch that. you can't stop it.
> >
> > On Mon, May 7, 2018 at 12:52 PM, Igor Korot  wrote:
> >>
> >> Hi, Paul,
> >>
> >> On Mon, May 7, 2018 at 11:42 AM, Paul Davis 
> >> wrote:
> >> > If there is a window manager (and there just about always is), you can't
> >> > stop it from doing what it is configured to do. You're just an
> >> > application,
> >> > and it takes higher priority managing window events than you.
> >>
> >> Yes, we are using FVWM as WM.
> >> I got a suggestion to write a function for this WM to stop the
> >> Terminal to appear
> >> when our Lock Screen is active, but here no one is familiar enough with
> >> this WM
> >> to write such a function.
> >>
> >> And I guess a different route is just not possible.
> >>
> >> And I would also guess that even if I put the "stay on top" flag,
> >> pressing the ALT+TAB will
> >> definitely switch the focus. Am I correct?
> >>
> >> Thank you.
> >>
> >> >
> >> > On Mon, May 7, 2018 at 12:01 PM, Igor Korot  wrote:
> >> >>
> >> >>  Hi, ALL,
> >> >> Is it possible to catch the ALT+TAB when one particular window is
> >> >> displayed and do nothing, i.e. not switch to a different window?
> >> >>
> >> >> We have a program which displays a full sized window without the
> >> >> title. Its role is to Lock screen" - user should not be able to do
> >> >> anything until (s)he supplies password and hit the "Authenticate"
> >> >> button.
> >> >> problem is that t is possible to hit "ALT+TAB" and switch the focus to
> >> >> the window below it (such as Terminal) and type something.
> >> >>
> >> >> We also can't use the lock screen window because of some other issues.
> >> >>
> >> >> So is it possible to catch ALT+TAB and do nothing for one specific
> >> >> window?
> >> >>
> >> >> On the side note - is there a better list (with more traffic) where I
> >> >> can post  question like this? Or this list is still good and
> >> >> operational?
> >> >>
> >> >> Thank you.
> >> >> ___
> >> >> gtk-list mailing list
> >> >> gtk-list@gnome.org
> >> >> https://mail.gnome.org/mailman/listinfo/gtk-list
> >> >
> >> >
> >
> >
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list

-- 
James Cameron
http://quozl.netrek.org/
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Is it possible to catch ALT+TAB and do nothing

2018-05-07 Thread James Cameron
On Mon, May 07, 2018 at 05:03:40PM -0500, Igor Korot wrote:
> James,
> 
> On Mon, May 7, 2018 at 4:46 PM, James Cameron  wrote:
> > On Mon, May 07, 2018 at 04:27:57PM -0500, Igor Korot wrote:
> >> Paul et al,
> >> Any idea how to configure FVWM to not to give focus to xterm if one
> >> specific window is displayed?
> >
> > You might ask on an fvwm mailing list, but fvwm does have a
> > NeverFocus method that can be applied to an application such as xterm.
> 
> Yes, just subscribed to their forum and will ask that question.
> >
> > http://www.fvwm.org/documentation/manpages/fvwm.html
> >
> > But that would just fix your problem for xterm; to enforce focus for a
> > lock screen, there's more to do.  Have a look at the code for other
> > lock screens to find out what that is.
> 
> We do not provide any external application where the user can interact
> with the keyboard/focus handling
> in order to try and guess the information that should be secured.
> Only the xterm is a concern.

If this is an embedded system or kiosk application, replace xterm with
something of your own making that uses libvte as a widget.  That way
you can assert full control over when the widget is visible.

I've found VTE acceptable for most use cases I've thrown at it.

Though I still use xterm when I can.

> [...]

-- 
James Cameron
http://quozl.netrek.org/
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: trouble with g_stat

2018-06-03 Thread James Cameron
On Sun, Jun 03, 2018 at 10:27:48PM -0400, GaryW wrote:
> My use of g_stat causes a segfault, but regular stat works ok. I’m using
> mingw64 on Win10 under msys2.
> [...]
> 
> GString *fspec;
> 
> GStatBuf *stBuf;
> 
> //fspec->str tested to hold the correct file spec…
> 
> if(g_stat(fspec->str,stBuf)<0){… [9476 Segmentation fault]

stBuf is an uninitialised pointer.  g_stat will try to write to the
address; undefined behaviour results.

Try allocating some memory of the right size, and assign that address
to the pointer before calling g_stat?

-- 
James Cameron
http://quozl.netrek.org/
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: XTestFakeKeyEvent GDK-equivalent

2018-07-06 Thread James Cameron
For quick hacks or testing apps, I use xdotool.  I've no idea if it
works with Wayland though.

-- 
James Cameron
http://quozl.netrek.org/
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Closing XTerm causes the GTK app to exit, inspite of disown/nohup on its PID - why?

2019-03-05 Thread James Cameron
Wild guess; use strace to look for a signal at the time the window is
closed, and add code to replace the handler for the signal.

For instance, to handle Ctrl+C gracefully in Python that uses GTK,
some of my code does this;

GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, callback)

-- 
James Cameron
http://quozl.netrek.org/
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list