Wayland

get the list of active windows in wayland weston

我怕爱的太早我们不能终老 提交于 2020-01-01 05:11:07
问题 How to get the list of active windows in wayland.. ie, in my window one terminal is active and a calculator is also active, I need to get the details of these windows in terminal , how can I get it ? 回答1: Basically, you can't. The main idea of the Wayland protocol is that a client doesn't know anything about the rest of the world. You can, however, modify your compositor so that it will record the information you need about every windows in it and use those informations at will. Modifying a

How do I set the x,y coordinates of a window in Wayland?

不羁的心 提交于 2019-12-21 09:07:12
问题 Apparently this is something that's not part of the core Wayland protocol, but I am using Weston and the xdg-shell extension appears to have the necessary method: xdg_surface_set_window_geometry So I ran wayland-scanner to create xdg code and header files: wayland-scanner code < ./weston-1.6.0/protocol/xdg-shell.xml > xdg_shell.c wayland-scanner client-header < ./weston-1.6.0/protocol/xdg-shell.xml > xdg_shell.h The code I'm using is roughly as follows: surface = wl_compositor_create_surface

How do I get the active window on Gnome Wayland?

你。 提交于 2019-12-20 09:28:43
问题 Background: I'm working on a piece of software called ActivityWatch that logs what you do on your computer. Basically an attempt at addressing some of the issues with: RescueTime, selfspy, arbtt, etc. One of the core things we do is log information about the active window (class and title). In the past, this has been done using on Linux using xprop and now python-xlib without issue. But now we have a problem: Wayland is on the rise, and as far as I can see Wayland has no notion of an active

Effective way of detecting X11 vs Wayland, preferrably with CMake

与世无争的帅哥 提交于 2019-12-12 19:39:32
问题 So I've done some Google searching and this is something that has very little knowledge out there. What would be an effective and foolproof way of detecting whether X11 or Wayland is in use, preferrably at compile-time and with CMake? I need to apply this to a C++ project of mine. 回答1: I assume you want to evaluate the display server during compile time, when calling CMake, instead of for every compilation. That's how CMake works and hot it should be used. One downside is, that you have to re

Is it possible to remove Weston toolbar?

人盡茶涼 提交于 2019-12-11 13:34:41
问题 Is it possible to have weston run without the toolbar at the top and change the background to black. So that when i have a script in init.d it calls weston first than my qt5 app? such as: weston & /home/root/app -platform wayland 回答1: you can change the background settings in weston.ini. For the toolbar you just have to return 0 in want_panel function in clients/desktop_shell.c 回答2: You can also just add panel-location string weston.ini [shell] section like this : [shell] panel-location=""

can struct type itself be passed to function as parameter in c?

拟墨画扇 提交于 2019-12-11 04:17:13
问题 While studying wayland protocol, I found code that functions takes struct type as parameter. #include <wayland-server.h> static struct wl_compositor_interface compositor_interface = {&compositor_create_surface, &compositor_create_region}; int main() { wl_global_create (display, &wl_compositor_interface, 3, NULL, &compositor_bind); } signature of wl_global_create is struct wl_global* wl_global_create (struct wl_display *display, const struct wl_interface *interface, int version, void *data, wl

How do I set the x,y coordinates of a window in Wayland?

社会主义新天地 提交于 2019-12-04 05:03:38
Apparently this is something that's not part of the core Wayland protocol, but I am using Weston and the xdg-shell extension appears to have the necessary method: xdg_surface_set_window_geometry So I ran wayland-scanner to create xdg code and header files: wayland-scanner code < ./weston-1.6.0/protocol/xdg-shell.xml > xdg_shell.c wayland-scanner client-header < ./weston-1.6.0/protocol/xdg-shell.xml > xdg_shell.h The code I'm using is roughly as follows: surface = wl_compositor_create_surface(compositor); if(surface == NULL) { ... } native_window = wl_egl_window_create(surface, some_width, some

get the list of active windows in wayland weston

[亡魂溺海] 提交于 2019-12-03 13:42:57
How to get the list of active windows in wayland.. ie, in my window one terminal is active and a calculator is also active, I need to get the details of these windows in terminal , how can I get it ? Basically, you can't. The main idea of the Wayland protocol is that a client doesn't know anything about the rest of the world. You can, however, modify your compositor so that it will record the information you need about every windows in it and use those informations at will. Modifying a compositor, however, is a bit complex for a SO answer (and beyond my knowledge) so I guess you'll have to

Wayland协议解析

匿名 (未验证) 提交于 2019-12-03 00:22:01
Wayland协议的理解就是对wayland的协议文件xml的理解。 Wayland是一种窗口管理协议.它的协议都定义在wayland.xml文件里面, 协议其实就是定义一组一组的接口.包含关系如下: Interface 接口 比如: wl_shm { } 其中 请求 ,是在服务器端需要实现的接口,在客户端调用。而 事件 是在服务器端调用,在客户端实现的接口。而 枚举 是当前接口提供的带有具体含义的常量值。这些定义,一般都有一项xml值来描述其功能含义。(比如: description/ summary) 因此, wayland协议文件xml里面就是由多个interface接口组成。 然后再详细分析: 请求和事件都是定义的函数接口,既然是函数,那么肯定就会涉及到参数,因此,在request/event的xml项内,包含子项arg,就是描述该请求的参数( 注意: 所有的 request/event 函数都有默认参数, request 的默认参数有两个,一个是指示调用该接口的客户端指针, 一个是指示接口信息的参数; event 的默认参数有一个,就是该 event 所在的 interface 的指针,和 this 指针作用类似。 默认参数是不会在 xml 协议文件中写出来, 阅读的时候需要自己注意 ),参数包括多项: 参数的名字, 参数的类型,参数的功能描述,

Wayland消息队列

匿名 (未验证) 提交于 2019-12-02 23:59:01
主消息队列 调用wl_display_dispath()函数的线程会自动成为主线程,并且拥有主消息队列。 wl_proxy消息队列 Wayland允许创建多个消息队列,使用wl_display_create_queue()创建,新建的消息队列可以绑定到一个wl_proxy对象上。 消息循环 与Win32消息循环不同,Wayland消息循环只需要调用一个函数: int ret = 0 ; while ( ret !=- 1 ) ret = wl_display_dispatch ( dpy ); wl_proxy消息队列的消息循环使用: int ret = 0 ; while ( ret !=- 1 ) ret = wl_display_dispatch_queue ( dpy , queue ); Wayland消息处理 Wayland没有窗口函数,而是使用wl_proxy listener处理具体的消息。wl_proxy代表服务器端的对象,服务器发送的消息会放入消息队列,如果使用wl_proxy_set_queue()设置过其他消息队列,则消息会放入指定的消息队列,wl_display_dispatch负责读取消息并调用proxy的listener。proxy的listener是由 wl_proxy_add_listener()指定的。 wl_proxy listener wl