Forum > Linux

Move a window between Workspaces

(1/8) > >>

dbannon:
Linux has a "Workspace" facility, typically four virtual screens you can switch between.

Does anyone know if LCL can move a window between workspaces. I currently call a wmctrl (a stand alone binary) process to do this but its becoming inconvenient to do so in a AppImage. And, honestly, the "process" approach is pretty lazy !

Any suggestions ?

Davo

Zvoni:
Can you "debug" during "manual" switch?
Say, check the Value of DefaultMonitor, Owner, parent (and other "suspects") before the switch, then check it again after the manual switch (CTRL+SHIFT+PageUp/Down?)

MarkMLl:
On Windows there's a specific abstraction layer for this sort of thing, based on windowspaces(?).

On typical unix systems this is a window manager operation starting off with fvwm IIRC, so I think it's basically down to working out what library/protocol wmctrl uses.

I've looked at related problems in the past, e.g. "is any desktop/workspace displaying a recognisable error dialogue", and not been able to get any further than that.

MarkMLl

dbannon:
Thanks Zvoni, Mark,


--- Quote from: Zvoni on September 02, 2024, 11:30:08 am ---Can you "debug" during "manual" switch?
Say, check the Value of DefaultMonitor, Owner, parent (and other "suspects") before the switch, then check it again after the manual switch (CTRL+SHIFT+PageUp/Down?)

--- End quote ---

Hmm, I had an old test project from last time I tried this. Form2 left:632 DFM:dmActiveForm POS:poDesigned STY:fsNormal

(DFM, default monitor, POS, Position, Sty, FormStyle) - they don't change. I had not tried Owner nor Parent but just now, seems 'Name' is not valid ?? Either triggers an access violation.


--- 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";}};} ---//    writeln(' OWN:', self.Owner.Name);//    writeln(' PNT:', self.Parent.Name);
But poking around, I did find that calling ~.Hide; ~.show; actually brings it to the current workspace. If its already in the current workspace, it flickers. Not sure I like that, if someone has selected it, (in my case, from a menu from the SystemTrayIcon) its because they are looking for it, so, maybe that flicker is a good thing, it says, here, over here !

But sometimes, again, in my case, the window can be a bit slow to render because it has a lot of (marked up text) content, "further research is indicated".


--- 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";}};} ---    Form2.EnsureVisible(True);    Form2.Hide;    Form2.Show;
Mark :
Second time I have have seen you mention this "virtual desktop" idea on Windows ?  Is it common ?  I don't think I have ever seen it used on Windows ....

Davo

MarkMLl:
I think that WMs classically implemented it by minimise/restore operations like you've shown, but that doesn't mean that they haven't- relatively recently- gained at least per-window attributes etc. acting as guidelines. There's a whole lot of implementation stuff at the WM level that I've never managed to grok: starting off with font metrics etc.


--- Quote from: dbannon on September 02, 2024, 01:37:59 pm ---Second time I have have seen you mention this "virtual desktop" idea on Windows ?  Is it common ?  I don't think I have ever seen it used on Windows ....

--- End quote ---

NT4(?) had a variant called Terminal Server Edition which was basically there as a swipe at X11 and/or VNC and was based on the Window Station management layer, I believe this got rolled into the standard Server product from W2K onward. NT4's Resource Kit had a utility that used the same API to implement an arbitrary number of desktops, I've also used the same on XP but don't know about other versions. It was notably easier to move apps between desktops on Windows than on unix WMs.

I'm not sure, but I think unix started using "virtual desktops" etc. with fvwm, which was a derivative of fwm. So they've been around for a while, but not as a part of the underlying X11 API.

MarkMLl


--- 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";}};} ---(* The hierarchy appears to be:                                         *)(*                                                                      *)(* 1)   Each logon corresponds to a session. NT4W or NT4S supports a    *)(*      single session, NT4 TSE supports multiple sessions generally    *)(*      corresponding to client connections. According to               *)(*      http://www.winnetmag.com/Articles/Index.cfm?ArticleID=3594&pg=2 *)(*      the term "WinStation" may be synonymous with a session, in any  *)(*      case sessions are distinct and do not share user-accessible     *)(*      memory although winsta.dll appears to export enumeration and    *)(*      management functions.                                           *)(*                                                                      *)(* 2)   Each session supports one or more WindowStations. One of these  *)(*      is interactive, others may exist to support non-interactive     *)(*      services. From http://www.geocities.com/teohunboon/tools.htm it *)(*      appears that WindowStations exist in the global namespace, e.g. *)(*      "\Sessions\x\WindowStation\Winsta0 where x is a numeric from 1  *)(*      to the number of [active users]."                               *)(*                                                                      *)(* 3)   In the context of a particular session the interactive          *)(*      WindowStation supports a default desktop named "Default" and if *)(*      associated with a physical display at least one additional      *)(*      desktop used for screensavers. Desktop management programs may  *)(*      create additional desktops although naming conventions may be   *)(*      obscure.                                                        *)(*                                                                      *)(* A Microsoft document published in the NT 3.51 era stated that the    *)(* way to locate the desktop being used by the screen saver was to look *)(* at the registry to determine the name of the current screen saver    *)(* executable, examine the PE header of this to determine the process   *)(* name, walk the process list looking for this named process and       *)(* finally to query this to determine the desktop with which it was     *)(* associated. I note that the facilities for walking processes etc.    *)(* have improved since then and it may be that W2K or later makes this  *)(* job much easier.                                                     *) 
Note from the above (written circa 2002) the implication that non-displayed programs (i.e. services etc.) run in their own winstation. However other than having BTDT I claim no particular expertise or interest in the Windows APIs.

Navigation

[0] Message Index

[#] Next page

Go to full version