Forum > QT

(Solved) that possible to make QWindow appear on all Virtual Desktop with Xlib?

(1/3) > >>

AFFRIZA 亜風実:
Something like:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---uses  ..., Qt, QtWidgets;...procedure TfrDock.FormShow(Sender: TObject);var  SelfWindow: TWindow;  Atom: TAtom;  prop: culong;begin  Atom := XInternAtom(Display, '_NET_WM_DESKTOP', LongBool(1));  SelfWindow := QWidget_winId(TQtMainWindow(Self.Handle).Widget);  XChangeProperty(Display, SelfWindow, Atom, XA_CARDINAL,    32, PropModeReplace, @prop, 1);   XMapWindow(Display, SelfWindow);end;   
EDIT:
I finally found the solution

* Do not set the ShowInTheTaskbar! Leave it stDefault >:D (previously I set the property to stNever, that's why it won't work! I ended up in the corner of my room because of frustration /justkidding)
* I don't know why, I need to use both _NET_WM_WINDOW_TYPE_DOCK (this one must be using XMapRaised, or the window is gone somewhere I don't know. It's on all Desktops and it shown in the Plasma Panel's Virtual Desktop Manager, but you can't see anywhere in the screen) and _NET_WM_DESKTOP!
And finally, here's the code:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TXWindowList.SetDockedMode(Window: TWindow);var  wmtype, wmdesktop, wmdock: TAtom;  prop: culong;begin  wmtype := XInternAtom(display, '_NET_WM_WINDOW_TYPE', False);  wmdock := XInternAtom(display, '_NET_WM_WINDOW_TYPE_DOCK', False);  wmdesktop := XInternAtom(display, '_NET_WM_DESKTOP', False);  prop := $FFFFFFFF;  XChangeProperty(fDisplay, Window, wmtype, XA_ATOM,    32, PropModeAppend, @wmdock, 1);  XMapRaised(fDisplay, Window);   XChangeProperty(fDisplay, Window, wmdesktop, XA_CARDINAL,    32, PropModeReplace, @prop, 1);  XMapWindow(fDisplay, Window);end;   // should activate window after this, not from TForm but from Xlib.  
Conclusion: I don't want to be dictated "you should use wmctrl" (seriously, 2 replies mentioned this even I already replied I don't want to use that) or "you should use (insert other library dependency)", those things doesn't answer the asked message. If it Xlib then answer Xlib, if it Wayland then answer Wayland, if you don't know then don't type anything. Also, there's no question about Raspberry or any barebone display library thing. I asked about possibility on Xlib, and that's mean it should be done on X! Especially when the person mentioned "I want to keep Plasma", so that supposed to work on KWin. Don't ruin the topic with bloated meaningless out of context replies. If someday any people who need to find this topic again, they won't getting lost on bunch of non-helping replies. Like typing, "you may be want to use inotify to monitor the disk change but it won't work on Windows, you should use Library(TM) to use this as a crossplatform solution" when the asking people not intended their app to run on Windows, that's not an answer.

MarkMLl:
What is a workspace in this context? I'm not sure but I suspect that this is a Window Manager concept, and that it's handled by minimise/restore operations (compared with Windows's support for WindowStations as a layer of abstraction).

MarkMLl

Fred vS:
Hello.

Sorry to disturb you with Qt but...

If you want something that will not need any dependencies and will have full control on what Xlib/X11 can do, maybe you may think to use MSEgui.

With MSEgui, all what you asked in your last posts, (custom toolbar with transparent background, use of BGRABitmap, etc) can be done, easy and without any dependencies.
You may even create what you want for a "pure" X11 system, where no one widget set is installed (even without GTK2).
Of course it will work also on systems with GTK2, QT, KDE, ... installed.

[EDIT] And it will be compatible with Wayland/XWayland.

And the same code can be used for Windows, with direct access to windows-gdi low level.

Fre;D

dbannon:
While you might get that to work on some desktops, I think it would be unlikely to do so on a wayland controlled one.

A better approach might be to use wmctrl to switch the window of interest to the current workspace.

Davo

AFFRIZA 亜風実:

--- Quote from: MarkMLl on June 19, 2022, 01:00:07 pm ---What is a workspace in this context? I'm not sure but I suspect that this is a Window Manager concept, and that it's handled by minimise/restore operations (compared with Windows's support for WindowStations as a layer of abstraction).

MarkMLl

--- End quote ---
Yeah, kind of like Window Manager concept but I don't want to make a full scale WM, just the task manager. I think the correct word is Virtual Desktop, I'm not sure which one (I guess?).
Currently it works really well but the problem is if switch to desktop 2, the taskbar just gone. Or, should I make multiple form?

The project repository is here: https://github.com/kirana-a2district/samarinda-dock


--- Quote from: Fred vS on June 19, 2022, 01:01:45 pm ---Hello.

Sorry to disturb you with Qt but...

If you want something that will not need any dependencies and will have full control on what Xlib/X11 can do, maybe you may think to use MSEgui.

With MSEgui, all what you asked in your last posts, (custom toolbar with transparent background, use of BGRABitmap, etc) can be done, easy and without any dependencies.
You may even create what you want for a "pure" X11 system, where no one widget set is installed (even without GTK2).
Of course it will work also on systems with GTK2, QT, KDE, ... installed.

[EDIT] And it will be compatible with Wayland/XWayland.

And the same code can be used for Windows, with direct access to windows-gdi low level.

Fre;D

--- End quote ---
Wow, interesting, I'll check that. But for now, I think I'm quite happy with Qt.


--- Quote from: dbannon on June 19, 2022, 01:05:44 pm ---While you might get that to work on some desktops, I think it would be unlikely to do so on a wayland controlled one.

A better approach might be to use wmctrl to switch the window of interest to the current workspace.

Davo

--- End quote ---
Actually, I only want my app only in X11 for now. I'll try to use wmctrl but I it possible I want the dependency is minimum.

Navigation

[0] Message Index

[#] Next page

Go to full version