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).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?).
MarkMLl
Hello.Wow, interesting, I'll check that. But for now, I think I'm quite happy with Qt.
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 (https://github.com/mse-org/mseide-msegui).
With MSEgui (https://github.com/mse-org/mseide-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
While you might get that to work on some desktops, I think it would be unlikely to do so on a wayland controlled one.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.
A better approach might be to use wmctrl to switch the window of interest to the current workspace.
Davo
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?
An X11/unix Window Manager is not a concept, it's a specific term for the subsystem which provides the "furniture" around Windows including scrollbars and the buttons on the title bar.Yeah, but I don't want to make a Window Manager, just the taskbar. I want to keep a minimal plasma panel on the top while my app handle the minimize and maximize event, just let the KWin doing it's job. But, I think that's not my question.
Traditionally, you could stop the current Window Manager and replace it with a different one... something that might be more difficult now that it typically includes the desktop environment's taskbar etc. And while some WMs supported multiple Virtual Desktops hence also a "pin" button, others didn't. See https://en.wikipedia.org/wiki/Fvwm
MarkMLl
Yeah, but I don't want to make a Window Manager, just the taskbar.
Something like:
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;
Hello.I have read that. Anyway, after wondering around and reading the KWin source I finally found the solution. I'll update the code of the post.
Did you try with this?:
... prop:= $FFFFFFFF; XChangeProperty(Display, SelfWindow, Atom, XA_CARDINAL, 32, PropModeReplace, @prop, 1); ...
You may try also setting prop := 0, prop := 1, prop := 2, ... to set each virtual desktop.
See here:
https://stackoverflow.com/questions/43376991/stick-c-app-to-all-desktops
I'll update the code of the post.
Hello Dio Affriza.I'm glad if that's also helps ;) With experiment like this it will expand the code samples and tutorials, I hope many people will know Pascal can do anything and make it great again. 8)
I have tested your code for MSEgui and it works here for all kind of windowsusing only this (not _NET_WM_WINDOW_TYPE_DOCK) :
[EDIT] You are right, with NET_WM_WINDOW_TYPE_DOCK the window is shown in other desktops.
Otherwise the form is minimized in other desktops.
Many thanks for your exploration, I did learn very interesting things (that I added to MSEgui ;)).
[EDIT] For Windows GDI, in CreateWindowex(...) , set parameter dwExStyle to WS_EX_TOOLWINDOW.
Fre;D