Wayland API to get the id of focus window [Seema Singh]

Carsten Haitzler (The Rasterman) raster at rasterman.com
Thu Feb 20 22:36:34 PST 2014


On Fri, 21 Feb 2014 06:07:59 +0000 (GMT) Seema Singh <seema.singh at samsung.com>
said:

> Hi Carsten,
> 
> Thank you for your response.
> 
> >first... by module... what does this code do? is it an enlightenment module?
> >or is it some external client process?
> 
> it's not an enlightenment module. It's an external client process.
> 
> 
> >so maybe you should first explain what you are doing, where and why, and
> >then... we can figure out what to do about it. :)
> 
> In our NFC module we are trying to do a NFC conditional APP launch.
> Whenever a tag detects, client processes the Tag NDEF data and launch the
> application if its not launched. 
> Focus window pid is used for below check:
> 1. If focus window APP is not a NFC APP then launch the NFC APP
> 2. If already launched but not in focus then bring it to foreground.

ok. then you're doing it wrong.

if you're planning on this for tizen 3 or have upgraded EFL, then you want to
look at gustavo's app server api. this is available in efl 1.8 and up:

http://git.enlightenment.org/apps/terminology.git/tree/src/bin/app_server.c
http://git.enlightenment.org/apps/terminology.git/tree/src/bin/app_server.h
http://git.enlightenment.org/apps/terminology.git/tree/src/bin/app_server_eet.c
http://git.enlightenment.org/apps/terminology.git/tree/src/bin/app_server_eet.h

(and look at the elm_app_server api too that it uses).

an alternative for earlier efl is just to ipc to yourself:

http://git.enlightenment.org/apps/terminology.git/tree/src/bin/ipc.c
http://git.enlightenment.org/apps/terminology.git/tree/src/bin/ipc.h

it's pretty simple. app creates a unix socket unique to itself and its
environment, and any new execution of the same binary/app tries to connect to
itself. this is the same case with both app_server and the ipc examples above.
they both work regardless of the display system you use. your app talks to
itself and passes any relevant arguments/info to the existing instance. the
existing instance can do whatever it likes. if you want a window to appear
and/or become focused (become active) use elm_win_activate() on the window.
this will request the wm to "make the window active/bring attention to it/focus
it etc."... slight catch - there is no core wayland protocol for this
currently. this SHOULD be covered in the xdg_shell protocol, but this is new
and i haven't looked at it yet. ecore_evas attracts these things for you and
currently there is no implementation for this because of xdg_shell being new
and shiny and we have not gotten to implementing it all yet, BUT... if you do
what i suggest above, you WILL have an app that is portable and that WILL work
just as soon as the efl bits get hooked together and that the compositor you
have supports the protocols necessary for this.

let me just take the time to advise you to  NOT drop down to layers like
ecore_x in efl *IF* you want to be portable. let the layers that deal with
portability deal with it. if they are currently not, then it's either simply a
missing implementation in efl or maybe entirely missing protocol in wayland
land and working around it in your app will simply waste your time now AND in
future in removing stuff. work with us to ensure you have what you need
implemented. :)


> Regards,
> Seema.
> 
> ------- Original Message -------
> Sender : Carsten Haitzler<raster at rasterman.com> 
> Date   : Feb 20, 2014 18:52 (GMT+09:00)
> Title  : Re: Wayland API to get the id of  focus window  [Seema Singh]
> 
> On Thu, 20 Feb 2014 09:12:50 +0000 (GMT) Seema Singh <seema.singh at samsung.com>
> said:
> 
> > Hi All,
> > 
> > In our module we have used the below mentioned   ecore_x APIs.
> > 1.ecore_x_window_focus_get()
> > 2.ecore_x_netwm_pid_get()
> > 
> > We are planning to move to wayland platform. But  could not find the below
> > APIs in ecore_wayland.h file Please let me know if anyone has come across
> > the same issue.
> 
> first... by module... what does this code do? is it an enlightenment module?
> or is it some external client process?
> 
> if it's literally a module inside enlightenment... enlightenment knows the
> focus already - check other internal api's. you'll want to be looking at git
> master to track dev and features there as that is where the most complete
> wayland support is. as for pid - that would be something the compositor can
> get by interrogating the fd of the client socket connection.
> 
> if this is a 3rd party app/process, the answer is "the 3rd party process has
> no business knowing either of these bits of information for security reasons
> and simply cleanliness of design."
> 
> so maybe you should first explain what you are doing, where and why, and
> then... we can figure out what to do about it. :)
> 
> -- 
> ------------- Codito, ergo sum - "I code, therefore I am" --------------
> The Rasterman (Carsten Haitzler)    raster at rasterman.com
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> <p> </p><p> </p>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster at rasterman.com



More information about the wayland-devel mailing list