Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add _NET_WM_PID atom to Linux X11 window #17444

Open
lindexi opened this issue Nov 7, 2024 · 1 comment · May be fixed by #17470
Open

Add _NET_WM_PID atom to Linux X11 window #17444

lindexi opened this issue Nov 7, 2024 · 1 comment · May be fixed by #17470
Labels
area-x11 enhancement help-wanted A contribution from the community would be most welcome. os-linux

Comments

@lindexi
Copy link
Contributor

lindexi commented Nov 7, 2024

Is your feature request related to a problem? Please describe.

My internal windows manger tool will read the _NET_WM_PID atom from X11 window to know the Process Id. The internal windows manger tool works well on the GTK application, because the GTK application will set the _NET_WM_PID atom. But it can not work with the Avalonia application, because the Avalonia application do not set the _NET_WM_PID atom.

Describe the solution you'd like

I want to add the _NET_WM_PID when the X11 window be created in Avalonia.

_handle = XCreateWindow(_x11.Display, _x11.RootWindow, 10, 10, defaultWidth, defaultHeight, 0,
depth,
(int)CreateWindowArgs.InputOutput,
visual,
new UIntPtr((uint)valueMask), ref attr);

And I find the Avalonia already define the _NET_WM_PID atom:

public IntPtr _NET_WM_PID;

Describe alternatives you've considered

No response

Additional context

gdkwindow-x11.c:

      long pid = getpid ();
      XChangeProperty (xdisplay, xid,
                       gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "_NET_WM_PID"),
                       XA_CARDINAL, 32,
                       PropModeReplace,
                       (guchar *)&pid, 1);
@kekekeks kekekeks added the help-wanted A contribution from the community would be most welcome. label Nov 7, 2024
@timunie
Copy link
Contributor

timunie commented Nov 7, 2024

@lindexi a PR is welcome 😁

lindexi added a commit to dotnet-campus/Avalonia that referenced this issue Nov 11, 2024
@lindexi lindexi linked a pull request Nov 11, 2024 that will close this issue
3 tasks
walterlv pushed a commit to dotnet-campus/Avalonia that referenced this issue Nov 11, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-x11 enhancement help-wanted A contribution from the community would be most welcome. os-linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants