Re: Getting focus

2016-08-25 Thread Gerald Nunn
That's my understanding for Wayland as well, I'd be interested in
knowing if that's wrong as well since it's been an oft requested
feature for terminix.

On Thu, Aug 25, 2016 at 6:51 AM, pelzflorian (Florian Pelz)
 wrote:
> I believe shell integration is the only clean way to do a
> Wayland-compatible guake. Am I wrong?
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Getting focus

2016-08-25 Thread pelzflorian (Florian Pelz)
I believe shell integration is the only clean way to do a
Wayland-compatible guake. Am I wrong?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Getting focus

2016-08-23 Thread rastersoft
This is odd! If I change
"org.gnome.desktop.wm.preferences.disable-workarounds" to TRUE,
everything works fine


El 23/08/16 a las 19:11, rastersoft escribió:
> Well, it seems that destroying the window and creating it again also
> doesn't work.
>
> It seems that I can't "steal" the focus when it is in other application,
> but if my app has the focus in one window, I can pass it to another one
> using grab_focus().
>
>
> El 23/08/16 a las 16:24, rastersoft escribió:
>> Hi:
>>
 It's not a problem of being early: I even tried to put a 1-second timer
 to call to grab_focus(), but didn't work.

 In fact, the first time I create the window it works fine, but seems to
 fail when I hide it and show it again.
>>> So it may be related to the window manager?
>> I suspect that. In fact, I think I'm going to just save the internal
>> widget and create a new window every time I press the hotkey.
>>
>> It is a guake clone written in Vala, using Gtk3. I'm using libkeybinder
>> to detect a global key. It is the same library used by guake and
>> terminator, but they use Gtk2. I also implemented a guake mode in
>> terminator, but had to do some tricks to ensure that the window received
>> the focus on those same cases when my vala code fails (I use a
>> show-hide-show scheme, that seems to guarantee that the window receives
>> the focus; but it seems to work only with gtk2, but not gtk3).
>>
>>> Is it Linux with Gnome3 shell? Gnome 3.20?
>> That's right. I'm using debian sid.
>>
>>> May other programs steal the focus?
>> No, AFAIK.
>>
>>> Do other tools work fine? When you hide and show gedit, will it have
>>> the focus?
>>>
>> Yes, everything works fine.
>>

-- 
Nos leemos
 RASTER(Linux user #228804)
ras...@rastersoft.com  http://www.rastersoft.com

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Getting focus

2016-08-23 Thread rastersoft
Well, it seems that destroying the window and creating it again also
doesn't work.

It seems that I can't "steal" the focus when it is in other application,
but if my app has the focus in one window, I can pass it to another one
using grab_focus().


El 23/08/16 a las 16:24, rastersoft escribió:
> Hi:
>
>>> It's not a problem of being early: I even tried to put a 1-second timer
>>> to call to grab_focus(), but didn't work.
>>>
>>> In fact, the first time I create the window it works fine, but seems to
>>> fail when I hide it and show it again.
>> So it may be related to the window manager?
> I suspect that. In fact, I think I'm going to just save the internal
> widget and create a new window every time I press the hotkey.
>
> It is a guake clone written in Vala, using Gtk3. I'm using libkeybinder
> to detect a global key. It is the same library used by guake and
> terminator, but they use Gtk2. I also implemented a guake mode in
> terminator, but had to do some tricks to ensure that the window received
> the focus on those same cases when my vala code fails (I use a
> show-hide-show scheme, that seems to guarantee that the window receives
> the focus; but it seems to work only with gtk2, but not gtk3).
>
>> Is it Linux with Gnome3 shell? Gnome 3.20?
> That's right. I'm using debian sid.
>
>> May other programs steal the focus?
> No, AFAIK.
>
>> Do other tools work fine? When you hide and show gedit, will it have
>> the focus?
>>
> Yes, everything works fine.
>

-- 
Nos leemos
 RASTER(Linux user #228804)
ras...@rastersoft.com  http://www.rastersoft.com

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Getting focus

2016-08-23 Thread rastersoft
Hi:

>> It's not a problem of being early: I even tried to put a 1-second timer
>> to call to grab_focus(), but didn't work.
>>
>> In fact, the first time I create the window it works fine, but seems to
>> fail when I hide it and show it again.
> So it may be related to the window manager?

I suspect that. In fact, I think I'm going to just save the internal
widget and create a new window every time I press the hotkey.

It is a guake clone written in Vala, using Gtk3. I'm using libkeybinder
to detect a global key. It is the same library used by guake and
terminator, but they use Gtk2. I also implemented a guake mode in
terminator, but had to do some tricks to ensure that the window received
the focus on those same cases when my vala code fails (I use a
show-hide-show scheme, that seems to guarantee that the window receives
the focus; but it seems to work only with gtk2, but not gtk3).

> Is it Linux with Gnome3 shell? Gnome 3.20?

That's right. I'm using debian sid.

> May other programs steal the focus?

No, AFAIK.

> Do other tools work fine? When you hide and show gedit, will it have
> the focus?
>

Yes, everything works fine.

-- 
Nos leemos
 RASTER(Linux user #228804)
ras...@rastersoft.com  http://www.rastersoft.com

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Getting focus

2016-08-23 Thread Stefan Salewski
On Tue, 2016-08-23 at 00:38 +0200, rastersoft wrote:
> It's not a problem of being early: I even tried to put a 1-second timer
> to call to grab_focus(), but didn't work.
> 
> In fact, the first time I create the window it works fine, but seems to
> fail when I hide it and show it again.

So it may be related to the window manager?

Is it Linux with Gnome3 shell? Gnome 3.20?

May other programs steal the focus?

Do other tools work fine? When you hide and show gedit, will it have
the focus?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Getting focus

2016-08-22 Thread rastersoft
It's not a problem of being early: I even tried to put a 1-second timer
to call to grab_focus(), but didn't work.

In fact, the first time I create the window it works fine, but seems to
fail when I hide it and show it again.

El 22/08/16 a las 20:42, Stefan Salewski escribió:
> On Sun, 2016-08-21 at 21:56 +0200, rastersoft wrote:
>> I tried to
>> call "grab_focus" on the "map" callback... but doesn't work.
> The map signal may be too early.
>
> Maybe g_signal_connect_after() may work.
>
> After map signal map_event is emmited, maybe you can use that one.
>
> Or try the draw signal, I guess it should be emmited after map signal.
>
>
>

-- 
Nos leemos
 RASTER(Linux user #228804)
ras...@rastersoft.com  http://www.rastersoft.com

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Getting focus

2016-08-22 Thread Stefan Salewski
On Sun, 2016-08-21 at 21:56 +0200, rastersoft wrote:
> I tried to
> call "grab_focus" on the "map" callback... but doesn't work.

The map signal may be too early.

Maybe g_signal_connect_after() may work.

After map signal map_event is emmited, maybe you can use that one.

Or try the draw signal, I guess it should be emmited after map signal.


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Getting focus

2016-08-21 Thread rastersoft
Hi all:

I'm creating a guake-like terminal, but I'm having problems to ensure
that the window has the focus.

The idea is that I have a global shortcut that, when pressed, will show
a terminal window. The problem is that, under certain circumstances, I'm
unable to ensure that the window will receive the focus.

I tried to use "present()". Also a "show/hide/show" trick. I tried to
call "grab_focus" on the "map" callback... but doesn't work. If the
window had previously the focus before being hiden, then it regains the
focus when presented; but if it loses the focus before being hiden, then
it doesn't recover the focus until I do a click on the window.

I'm working with Vala and Gtk3.


-- 
Nos leemos
 RASTER(Linux user #228804)
ras...@rastersoft.com  http://www.rastersoft.com

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list