Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back the window role to differentiate presentation and presenter #540

Closed
lambtho12 opened this issue Jul 2, 2020 · 7 comments
Closed

Comments

@lambtho12
Copy link

In commit e1c39d8 , a part of the code common to presentation and presenter was moved to fullscreen. In the process, the role attribute was dropped. This attribute is really important for some tiling window manager (such as awesomewm), as it allows to easily differentiate the two windows and ensure their correct display (see issues #66, #79 for instance).

I never used vala before, but I guess something along these lines in fullscreen.vala should do it

this.title = is_presenter ? "presenter" : "presentation";

pdfpc version: 4.4.0

@fnevgeny
Copy link
Member

fnevgeny commented Jul 2, 2020

@lambtho12
Copy link
Author

Sorry my bad. I wanted to say

this.role = is_presenter ? "presenter" : "presentation";

Title are indeed already there. It is the role attribute that is missing

@fnevgeny
Copy link
Member

fnevgeny commented Jul 2, 2020

But why do you need the role attribute set if a distinct title is present? It's X11-specific and, furthermore, "If a window already has a unique title, you don’t need to set the role, since the WM can use the title to identify the window when restoring the session." https://valadoc.org/gtk+-3.0/Gtk.Window.set_role.html

@lambtho12
Copy link
Author

lambtho12 commented Jul 2, 2020

I was trying to replicate this fix proposed in #79. This is easier as the role is fixed while the title changes based on the name of the document.
But I guess I can try to filter using the window name and a wildcard or something instead of simply using the role.

I will close this issue and try to find a way directly in awesome. If it works, then maybe we can add it to the FAQ along with the solution for i3-wm

@fnevgeny
Copy link
Member

fnevgeny commented Jul 2, 2020

Just in case, try enabling move-on-mapped in pdfpcrc. Maybe you don't need any tricks with titles at all.

@lambtho12
Copy link
Author

Thank you for this suggestion, but it does not seems to work (the presentation is on the right screen but not in fullscreen).

If anyone is interested, here is the current rule I have that seems to be working ok (it needs more testing to be 100% sure)

-- PDFPC (Open on top and in fullscreen)
{
    rule_any = { 
        instance = { "pdfpc" }, 
        name = "pdfpc - presentation.*"
    },
    callback = function(c) 
        c:move_to_screen() 
    end,
    properties = { 
        ontop = true,
        maximized = true,
        fullscreen = true
    }
},

@fnevgeny
Copy link
Member

fnevgeny commented Jul 3, 2020

the presentation is on the right screen

Then move_to_screen() in your script is not needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants