Code Monkey home page Code Monkey logo

Comments (8)

sanjoymahajan avatar sanjoymahajan commented on July 26, 2024 1

I am using the default DesktopConfiguration (global). So I am not sure what is wrong. I will do some more tests and see if I can make a minimal config and example.

from fvwm3.

ThomasAdam avatar ThomasAdam commented on July 26, 2024

Hi @sanjoymahajan

I'm not sure I quite follow. GotoPag prev is already per-monitor aware. So it remembers each screen's last page, and if you run that command for either the implied current monitor, or a specific monitor, it works just fine for me.

from fvwm3.

sanjoymahajan avatar sanjoymahajan commented on July 26, 2024

I wanted GotoPage prev to be specific to the desktop (I hadn't thought about the monitor). Or is it already desktop-aware? I may have misunderstood or done my test incorrectly.

from fvwm3.

ThomasAdam avatar ThomasAdam commented on July 26, 2024

I wanted GotoPage prev to be specific to the desktop (I hadn't thought about the monitor). Or is it already desktop-aware? I may have misunderstood or done my test incorrectly.

It's both -- in that, if you have: DesktopConfiguration global set (which is the default), then GotoPage prev will go to the previous page.

If you have: DesktopConfiguration per-monitor set, then the desktop on that monitor is the one which is used, and GotoPage prev works in the same way.

from fvwm3.

somiaj avatar somiaj commented on July 26, 2024

I think I see what you are requesting, and you are correct, fvwm doesn't store the previous page per desk, only per monitor. So what you want is to recall the previous page per desk, per monitor.

Note that this could be implemented via storing this information in your setup using InfoStore along with FvwmEvent using the new_page event. Each time you move to a new page, use fvwm to save the variable of the previous page (you may have to first save the variable of the current page, then move this to the previous page), for instance bind the following function to the new_page event. I haven't tested this fully, but in theory it should work, you may need to tweak it though.

# Initialize the previous page and current page variables
# You need to do this for each desk you want to use.
InfoStoreAdd PrevPageX0 0
InfoStoreAdd PrevPageY0 0
InfoStoreAdd CurPageX0 0
InfoStoreAdd CurPageY0 0
InfoStoreAdd PrevPageX1 0
InfoStoreAdd PrevPageX2 0
InfoStoreAdd CurPageX1 0
InfoStoreAdd CurPageY1 0
...

# This function updates your variables when you switch pages.
DestroyFunc SavePageLoc
AddToFunc SavePageLoc
+ I InfoStoreAdd PrevPageX$[desk.n] $[infostore.CurPageY$[desk.n]]
+ I InfoStoreAdd PrevPageY$[desk.n] $[infostore.CurPageY$[desk.n]]
+ I InfoStoreAdd CurPageX[$desk.n] $[page.nx]
+ I InfoStoreAdd CurPageY[$desk.n] $[page.ny]

# Custom Previous Page Function
DestroyFunc MyPrevPage
AddToFunc MyPrevPage
+ I GotoPage $[infostore.PrevPageX$[desk.n]] $[infostore.PrevPageY$[desk.n]]

# Use FvwmEvent to update your variables
DestroyModuleConfig FE-NewPage: *
*FE-NewPage: Cmd Function
*FE-NewPage: new_page SavePageLoc

# Start FvwmEvent
AddToFunc StartFunction I Module FvwmEvent FE-NewPage

Note here is an alternative that should also work, seems you can also get the prev_page from the monitor variables, so instead adapt something like this.

DestroyFunc SavePageLoc
AddToFunc SavePageLoc
+ I InfoStoreAdd PrevPageX$[desk.n] $[monitor.$[monitor.primary].prev_pagex]
+ I InfoStoreAdd PrevPageY$[desk.n] $[monitor.$[monitor.primary].prev_pagey]

Though this might not be as good as the first approach, though simpler, it maybe harder
to guarantee that the variable saved by fvwm is for the current desk you are on, though you could try it (as mentioned I'm only brain storming here, I have not tested any of this actually works).

from fvwm3.

ThomasAdam avatar ThomasAdam commented on July 26, 2024

Right, OK. Yes, this is something you can use FvwmEvent for. I'm going to close this "bug", as it can be implemented using something like the above.

from fvwm3.

sanjoymahajan avatar sanjoymahajan commented on July 26, 2024

Thank you for the approaches and sample code. I have been experimenting with them. They hasn't worked yet (e.g., I cannot get a second FvwmEvent process to start). However, I think that the problem lies with my very incomplete / hack understanding of fvwm coding, so I am slowly working on that problem...

from fvwm3.

somiaj avatar somiaj commented on July 26, 2024

@sanjoymahajan I did have a small issue with how I was calling the FvwmEvent function, I fixed that. Note how I've given FvwmEvent a new name, FE-NewPage, this way you can have multiple running, since they have a new name.

from fvwm3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.