yad --no-focus prevents the window from getting focus at all

264 views
Skip to first unread message

Oliver Häßler

unread,
Nov 23, 2015, 7:56:09 AM11/23/15
to yad-common
I am playing around with the new --no-focus option in yad 0.32

The option is great however the option prevents the window from getting the focus at all, so even if I click on the window it is not getting the focus back.

Would it be possible to use the --no-focus option just for the start of the window, but clicking on it gives the focus back to the window?

Victor Ananjevsky

unread,
Nov 23, 2015, 9:09:05 AM11/23/15
to yad-c...@googlegroups.com

hi

i'm not sure that this will very useful

for some rare cases you can use workarounds like this one:

XID=$(xdotool getwindowfocus) # get XID of currently active window
yad --text=sample &
sleep 0.2 # wait yad window
wmctrl -i -a $XID # restore focus


В Mon, 23 Nov 2015 04:56:08 -0800 (PST)
Oliver Häßler <o.hae...@gmail.com> писал:
> --
> You received this message because you are subscribed to the Google Groups "yad-common" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
Victor Ananjevsky <anan...@gmail.com>

Oliver Häßler

unread,
Nov 23, 2015, 9:53:45 AM11/23/15
to yad-common
Hi Victor,

that could work.. I just need to get a build for my RHEL for xdotool.. so far it i not in the repos :D

what is the purpose of a window that has constantly no focus? just asking?

thanks
Oliver

Victor Ananjevsky

unread,
Nov 23, 2015, 10:26:34 AM11/23/15
to yad-c...@googlegroups.com
xdotool is just for example. you can use xprop instead

xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2

--no-focus with --on-top and --timeout - good for different kind of notifications
moreover this option may be usefull for creating button bars based on --form dialog


В Mon, 23 Nov 2015 06:53:44 -0800 (PST)
Oliver Häßler <o.hae...@gmail.com> писал:

> Hi Victor,
>
> that could work.. I just need to get a build for my RHEL for xdotool.. so
> far it i not in the repos :D
>
> what is the purpose of a window that has constantly no focus? just asking?
>
> thanks
> Oliver
>
> On Monday, November 23, 2015 at 3:09:05 PM UTC+1, Victor Ananjevsky wrote:
> >
> >
> > hi
> >
> > i'm not sure that this will very useful
> >
> > for some rare cases you can use workarounds like this one:
> >
> > XID=$(xdotool getwindowfocus) # get XID of currently active window
> > yad --text=sample &
> > sleep 0.2 # wait yad window
> > wmctrl -i -a $XID # restore focus
> >
> >
> > В Mon, 23 Nov 2015 04:56:08 -0800 (PST)
> > Oliver Häßler <o.hae...@gmail.com <javascript:>> писал:
> >
> > > I am playing around with the new --no-focus option in yad 0.32
> > >
> > > The option is great however the option prevents the window from getting
> > the
> > > focus at all, so even if I click on the window it is not getting the
> > focus
> > > back.
> > >
> > > Would it be possible to use the --no-focus option just for the start of
> > the
> > > window, but clicking on it gives the focus back to the window?
> > >
> > > --
> > > You received this message because you are subscribed to the Google
> > Groups "yad-common" group.
> > > To unsubscribe from this group and stop receiving emails from it, send
> > an email to yad-common+...@googlegroups.com <javascript:>.
> > > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > Victor Ananjevsky <anan...@gmail.com <javascript:>>

Oliver Häßler

unread,
Nov 24, 2015, 5:25:58 AM11/24/15
to yad-common
ahhh.. nice.. will give this also a try.

I am using the --no-focus with --on-top for notifications of updates, but also add a button to run the updates directly via yum. Thats how i saw that the window is not getting the focus back when i click on it. And Gnome makes the text in a dialogue kind of greyish instead of black, which makes it harder to read.

Victor Ananjevsky

unread,
Nov 24, 2015, 5:31:37 AM11/24/15
to yad-c...@googlegroups.com
you may also try --splash option for notifications

В Tue, 24 Nov 2015 02:25:57 -0800 (PST)
Oliver Häßler <o.hae...@gmail.com> писал:

> ahhh.. nice.. will give this also a try.
>
> I am using the --no-focus with --on-top for notifications of updates, but
> also add a button to run the updates directly via yum. Thats how i saw that
> the window is not getting the focus back when i click on it. And Gnome
> makes the text in a dialogue kind of greyish instead of black, which makes
> it harder to read.
>
> On Monday, November 23, 2015 at 4:26:34 PM UTC+1, Victor Ananjevsky wrote:
> >
> > xdotool is just for example. you can use xprop instead
> >
> > xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2
> >
> > --no-focus with --on-top and --timeout - good for different kind of
> > notifications
> > moreover this option may be usefull for creating button bars based on
> > --form dialog
> >
> >
> > В Mon, 23 Nov 2015 06:53:44 -0800 (PST)
> > Oliver Häßler <o.hae...@gmail.com <javascript:>> писал:

Oliver Häßler

unread,
Nov 27, 2015, 12:56:38 PM11/27/15
to yad-c...@googlegroups.com
Hi Victor,

so i tried your ideas, and there is one problem. The window I do not want to have focus has buttons. Which means it is waiting for a button press until it gives the focus back to the original window.

I have attached both scripts, one with using the no-focus option, and the other using xprop.

I would have thought that the --no-focus option in yad would actually work like what you have send me with using xprop and wmctrl. I give the --no-focus option and the window will be started with no focus, however it is still possible to give it focus by clicking on it.

The --splash screen has a UI issue for me as most of the apps that are used have this grey from the dialog. Now when you start a window with --splash, it is gray without windows borders. If you put that on the right top corner and Firefox is maximized, the window actually looks on top of Firefox like a glitch in the Firefox UI.

Hope that makes sense.

Also when you use the no-focus script one of the buttons say: Show all updates.This is a function in the bash script that is executed on button press. now i have all windows with the option: --on-top if I click the button for the first time, it will start another dialog like this:

yad --on-top --window-icon="$yad_window_icon" --geometry=450x200+$yad_position+0 --title="$windowtitle" --image="$yad_image" --form --field "$updates":LBL --scroll --button=gtk-ok:0

On first try this window gets behind the main window from the script with the 3 buttons. If I bring it to the front by clicking on it, close it and open it again, it gets to the front as expected. Not sure what that is.

Hope that helps,

Cheers
Oliver



--
You received this message because you are subscribed to a topic in the Google Groups "yad-common" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/yad-common/V7B3WbanpfM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to yad-common+...@googlegroups.com.
xprop_usage.sh
no-focus_usage.sh

Oliver Häßler

unread,
Dec 17, 2015, 6:41:17 AM12/17/15
to yad-common, o.hae...@gmail.com
Is there any feedback on if it could be possible to enable the window to get focus by clicking on it, and only start it without foucs?

also any idea about this part:

**** 
Also when you use the no-focus script one of the buttons say: Show all updates.This is a function in the bash script that is executed on button press. now i have all windows with the option: --on-top if I click the button for the first time, it will start another dialog like this:

yad --on-top --window-icon="$yad_window_icon" --geometry=450x200+$yad_position+0 --title="$windowtitle" --image="$yad_image" --form --field "$updates":LBL --scroll --button=gtk-ok:0

On first try this window gets behind the main window from the script with the 3 buttons. If I bring it to the front by clicking on it, close it and open it again, it gets to the front as expected. Not sure what that is.

****

Thanks a lot for the feedback.

Cheers
Oliver
> To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+unsubscribe@googlegroups.com.

> For more options, visit https://groups.google.com/d/optout.


--
Victor Ananjevsky <anan...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "yad-common" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/yad-common/V7B3WbanpfM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to yad-common+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages