Recent

Author Topic: Move a window between Workspaces  (Read 1988 times)

dbannon

  • Hero Member
  • *****
  • Posts: 3086
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Move a window between Workspaces
« Reply #30 on: September 09, 2024, 12:35:40 pm »
....
Presumably though that can be cached... although that is more the domain of xdg-screensaver being used to make sure a system doesn't go dark at an inopportune time ** .

Well, in my app for example, a user can open any number of non-modal windows over a period of time. I keep a list of the forms (and some other data), it would be very easy to grab the WindowID at each create time, store it in the list and use it directly when necessary. But finding the WindowID of a whole lot of windows at the same time could be slow.  Think I would build an index of all named windows, then its just a look up. Hmm, maybe no that slow ....

Its worth noting that a TWinow is actually a qword, someone is allowing for a lot of windows !  :D

Davo



 
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

MarkMLl

  • Hero Member
  • *****
  • Posts: 7682
Re: Move a window between Workspaces
« Reply #31 on: September 09, 2024, 12:42:46 pm »
Its worth noting that a TWinow is actually a qword, someone is allowing for a lot of windows !  :D

Yes, but being unix it's also going to be a pointer... although not necessarily on the local machine, which might make it unsafe to redeclare it as a ptruint.

Lifetime is going to be more of an issue, depending on whether windows are really being created and destroyed or merely hidden.

MarkMLl
« Last Edit: September 09, 2024, 02:16:26 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

dbannon

  • Hero Member
  • *****
  • Posts: 3086
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Move a window between Workspaces
« Reply #32 on: September 09, 2024, 01:54:36 pm »
Here is an  enhanced version of the demo, no change to MvXWindows unit.

I thought should show the "other" way to achieve what I set out to do here. That is, bring a Window, in another Workspace, here.  By just hiding it and then showing it again, yes, it pops up in the current workspace !  But if its already visible, it has a noticeable flicker.  I am not sure that is a bad thing, maybe its useful to draw the user's attention ?

I have not yet determined which approach I will use in my app, both approaches are documented in the demo.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dbannon

  • Hero Member
  • *****
  • Posts: 3086
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Move a window between Workspaces
« Reply #33 on: September 09, 2024, 02:05:28 pm »
And, Mark, thanks for the XKCD !  I think I remember that date but I did not think I'd told Munroe about it ....

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Aruna

  • Sr. Member
  • ****
  • Posts: 458
Re: Move a window between Workspaces
« Reply #34 on: September 19, 2024, 03:45:04 am »
Be interested in hearing how other (Linux) Desktops perform ?
Davo
@davo,
  • The first screenshot gnome-classic bottom right shows workspaces and the second workspace shows the moved window. Above that is a terminal that shows the desktop is gnome-classic
  • The second screenshot bottom left shows workspaces and the terminal shows the desktop is LXDE. Something I noticed is with LXDE everything loaded like lightning. Compared to gnome-classic things rendered blazingly fast
Debian GNU/Linux 11 (bullseye)
https://pascal.chat/

Aruna

  • Sr. Member
  • ****
  • Posts: 458
Re: Move a window between Workspaces
« Reply #35 on: September 19, 2024, 03:46:12 am »
    Be interested in hearing how other (Linux) Desktops perform ?
    Davo
    • The third screenshot terminal shows the desktop is cinnamon
    • and the fourth screenshot shows cinnamon workspaces and the moved window on workspace two. I will post others as and when I test them.
    Debian GNU/Linux 11 (bullseye)
    https://pascal.chat/

    dbannon

    • Hero Member
    • *****
    • Posts: 3086
      • tomboy-ng, a rewrite of the classic Tomboy
    Re: Move a window between Workspaces
    « Reply #36 on: September 19, 2024, 11:23:31 am »

    Hey, thanks Aruna, I take it you found it worked as expected ?

    Something I noticed is with LXDE everything loaded like lightning. Compared to gnome-classic things rendered blazingly fast
    Yeah, work on Gnome for a little while and everything else seem blindingly fast !

    I decided to use that code in my own project, far tidier than using wmctrl as I did previously.  I too have been testing all over the place and, so far, good.  Enlightenment being the exception ....

    Davo
    Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
    My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

    Aruna

    • Sr. Member
    • ****
    • Posts: 458
    Re: Move a window between Workspaces
    « Reply #37 on: September 19, 2024, 11:42:36 am »
    Hey, thanks Aruna, I take it you found it worked as expected ?
    You are most welcome. I only tested moving the window from it's initial workspace to another. I have to test bringing it back from a workspace. What I tested so far, yes works fine.  Btw, very nice how you have the time taken in milli secs. And any thank's should go to @Joanna and her buddy @kee as they were responsible for me finally getting Lazarus to compile under qemu.

    Something I noticed is with LXDE everything loaded like lightning. Compared to gnome-classic things rendered blazingly fast
    Yeah, work on Gnome for a little while and everything else seem blindingly fast !
    I was thinking 'what the heck just happened, I am  inside qemu and that took less than a second? Sweet! (Do you know what the lightest fastest WM is please?)

    I decided to use that code in my own project, far tidier than using wmctrl as I did previously.  I too have been testing all over the place and, so far, good.  Enlightenment being the exception ....
    My friend as a practising Buddhist I can assure you many have and are yet searching for Enlightenment! This is one of the reasons I love Lazarus. Every time I figure out something on my own I get enlightened?   8-)
    « Last Edit: September 19, 2024, 11:58:53 am by Aruna »
    Debian GNU/Linux 11 (bullseye)
    https://pascal.chat/

    dbannon

    • Hero Member
    • *****
    • Posts: 3086
      • tomboy-ng, a rewrite of the classic Tomboy
    Re: Move a window between Workspaces
    « Reply #38 on: September 19, 2024, 01:22:19 pm »
    ... And any thank's should go to @Joanna and her buddy @kee as they were responsible for me finally getting Lazarus to compile under qemu.
    Wow, you use qemu ?  Its hard work compared to Virtual Box, I only use qemu when I have to make out I have a different CPU. I spent some time running a POWERel emulator when Debian complained that my project would not compile there.  I currently have 29 Linux VM's on my laptop, all for testing my app under Virtual Box at release time.

    (Do you know what the lightest fastest WM is please?)
    Not from personal testing but its generally agreed that, of the mainstream desktops, its XFCe. And it works reasonably well, just a bit plain sometimes.

    My friend as a practising Buddhist I can assure you many have and are yet searching for Enlightenment!
    Ah, yes, Enlightenment is clearly a good idea. Unless you are talking about Linux desktops. I have a good friend who is always trying to convert me to (Linux) Enlightenment and its just not going to happen ! I hope your path to enlightenment is an easier one !

    Davo
    Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
    My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

     

    TinyPortal © 2005-2018