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

Presentation window always on top #22

Open
thamnos opened this issue May 9, 2014 · 22 comments
Open

Presentation window always on top #22

thamnos opened this issue May 9, 2014 · 22 comments
Assignees

Comments

@thamnos
Copy link

thamnos commented May 9, 2014

When I have a presentation in slider running, I can't find a way to see other windows on top of the presentation window. I would prefer to have the option to have other windows on top in two scenarios:

  1. I am practising my presentation without a second monitor / projector attached. In this case, I'd like to have the other windows of slider on top so that I can see on my laptop monitor the same windows that I will see during my presentation.
  2. I would like to show videos in my presentation. I'd therefore launch some way or another an "mplayer -fs". This will however be hidden by the presentation window.

P.S.: I'm using Gnome 3.10 (Ubuntu GNOME 14.04)

@TrilbyWhite
Copy link
Owner

Are you using the Ctrl-Tab binding to "unfullscreen" the presentation? If so, then the window is managed by your window manager after that - so it's stacking order and placement is up to gnome/metacity/mutter.

It works as expected in openbox.

@thamnos
Copy link
Author

thamnos commented May 9, 2014

Ah -- no, I didn't use Ctrl-Tab. When I do, it works.
Is there any chance to get the video visible directly from the fullscreen presentation? And/or would it be possible to play the videos directly in the pdf?

@TrilbyWhite
Copy link
Owner

Yes, you can play videos in the pdf. That's what the action links are for.

Set the Action.Movie handler to the video player of your choice. Then on a slide with a video, press 'a' to select the video with a mouse click, or Shift+a to play the first video on that slide (Ctrl-a for the second, Alt-a for the third).

@thamnos
Copy link
Author

thamnos commented May 11, 2014

I might need some coaching here... I downloaded http://adobetrainer.co.uk/Resources/MultimediaFile.pdf, opened it with slider, typed "a" and clicked on the "play" button of the video. I get a segfault. The core says:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000403847 in action_link ()
(gdb) list
1 ../sysdeps/x86_64/crti.S: No such file or directory.
which I guess is fair enough since I have neither a sysdeps directory nor a crti.S file. Any hints how to operate my computer?

@TrilbyWhite
Copy link
Owner

Several problems there. one, if you are going to play a media link, you do need to have that media: the pdf needs to specify a path the a valid media file. It looks like this pdf (that you didn't make I gather) requires associated files. Two, when I download that pdf, I do not detect any action links on the page. Adobe does a bunch of odd proprietary coding in their PDFs so they only work in adobe players. Slider uses the poppler pdf library - the extent of the pdf standard that is public, is supported.

I did however find that slider segfaults when one tries to follow an action link when there are no links on the page. I'll need to fix the segfault.

@TrilbyWhite
Copy link
Owner

Here are the different action links that can be used:
http://people.freedesktop.org/~ajohnson/docs/poppler-glib/poppler-PopplerAction.html

The segfault has been fixed.

@thamnos
Copy link
Author

thamnos commented May 11, 2014

Great, thanks! You are right, I didn't make that pdf myself, just tried to find an example of a pdf with an embedded movie online. I tried to produce a pdf using http://tex.stackexchange.com/questions/158771/video-in-beamer-with-multimedia-package-not-playing which results in a pdf where the video can be played when using Okular as pdf viewer -- but Slider does not not recognize a Link there, or am I missing the trick again?

@TrilbyWhite
Copy link
Owner

That's how I make my presentations, and movies work fine.

When you press "a" on the slide with the video link, is there a highlighting rectangle around the image for the movie?

EDIT: Actually I see a problem was recently introduced. The video plays but is not raised above the slider window. Does your video have audio? If so, you should be able to hear it playing - if not it may just seem like it is not playing. I'll have to track this bug down.

If this is the issue, then it will be resolved when I get around to replacing the override_redirect window with a better managed approach using NET_WM_FULLSCREEN instead. I just tested a very rough version of this and it resolved the window stacking issue - but it's not quite ready to be pushed here yet.

@thamnos
Copy link
Author

thamnos commented May 12, 2014

In my case, there is not even a highlighting rectangle around the image for the movie. And I've tried a video with sound -- it doesn't play.
This is the pdf; works for me in Okular but not in Slider:
https://dl.dropboxusercontent.com/u/57883099/multimedia.pdf
it was generated using
https://dl.dropboxusercontent.com/u/57883099/multimedia.tex
https://dl.dropboxusercontent.com/u/57883099/youtube.jpg
https://dl.dropboxusercontent.com/u/57883099/youtube.webm
where I took the youtube video from
http://www.youtube.com/watch?v=46pB71QqNhw
because I didn't have one with sound myself. I've also tested ogv and mp4 videos (without sound) from
http://www.adobe.com/inspire/2013/02/html5-video.html
with the same result.

What I can do, however, is to use a \url command to generate a link to the video file. When I then change the slider config file so that mplayer handles URLs rather than firefox, the video is opened in the background. Audible but invisible.

@TrilbyWhite
Copy link
Owner

Ah, that's why. That includes the movie, but it doesn't actually add an action link to play the movie.

Very few viewers will play a movie without the link - I thought adobe player was the only one, but it seems KDE has figured it out with Okular.

Try this in the frame:

\begin{center}
\movie[label=youtube]{}{youtube.webm}
\hyperlinkmovie[]{youtube}{
    \includegraphics[width=\textwidth]{youtube.jpg}
}
\end{center}

@thamnos
Copy link
Author

thamnos commented May 12, 2014

Thanks! While this version does not work in Okular, it starts playing the movie with slider (fullscreen in the background, i.e. you can hear it but not see it; only when I press the Windows key and Gnome3 displays an overview of all windows in the workspace, I can see that one of the windows is the fullscreen mplayer -- the slider presentation window does not appear in this overview). So I guess that this is the bug you talked about a couple of comments ago.

I don't know if you have access to Okular; what happens there is that the video is played in a predefined area of the page (not fullscreen). I guess that's quite a bit more difficult to program?

@TrilbyWhite
Copy link
Owner

That would not be difficult to add - I just never saw a reason for it. There are two ways to add that feature (to play in the constrained box): 1) use mplayer/mpv's -wid option, and 2) use the media player's -geometry (or similar) option.

I've experimented already with the first of these - while it works very well, it leads to one very undesirable side effect: the video will play, but it cannot be controlled. It can not be paused, stopped, scanned forward or back, nor can the volume of the video player be controlled (though of course system volume still works). This is apparently because the embedded versions of mplayer or mpv don't have all those controls.

The second option would be very easy to add. In fact, a recent patch for action-launch links does this very thing.

I'll put this option on the TODO list - but first I'm going to finish up the revision the the fullscreening mechanism to use EWMH "NET_WM_FULLSCREEN" properly. I've got this coded on my machine, but there is a bit to polish up before I push it to git.

So in summary, coming soon - and likely in this order:

  1. bug fix: video will play stacked above the presentation.
  2. change in behavior: presentation window will not be an override_redirect window (i.e. it will be managed by the window manager) instead it will request the WM to make it fullscreen.
  3. feature addition: videos will be able to be played in fullscreen (my preference) or 'framed' modes in which the later plays within the coordinates specified in the pdf.

EDIT: a potential number 4 is to figure out poppler's "movie" items. There are two ways movies can be linked in a pdf. Currently Slider only supports the ActionMovie approach, but there is also a separate Movie data type - documentation for this, however, is dreadful (just for this, most poppler documentation is wonderful). I suspect this explains the discrepancy between the two versions of latex code above. So in short, slider only currently supports action links which can play movies, in the future it may also support other media linking and embedding.

EDIT: I feel a bit silly, the documentation is there, just not where I expected it. The initial method you used for including the movie in latex includes it as an "annotation" rather than as an action link. I just tested with another poppler tool of mine and see that the annotation movie is readily detected. This means that the feature #4 can definitely be expected to be coming soon (or soonish).

@thamnos
Copy link
Author

thamnos commented May 12, 2014

awesome :)

@TrilbyWhite
Copy link
Owner

I believe all four of those goals were met in the most recent update I just pushed to github.

I just finished some binge coding, so it hasn't been tested too well yet - so try at your own risk.

I know of one issue that arose: the revision "broke" the fullscreen toggle for some window managers. It works fine on my WM (alopex) but I also tested it on openbox; under openbox slider starts out fullscreen, but once you toggle out of fullscreen it will not go back to "full" but rather only to maximized. I'm not sure why openbox isn't honoring the NET_WM_FULLSREEN message.

@TrilbyWhite TrilbyWhite self-assigned this May 13, 2014
@thamnos
Copy link
Author

thamnos commented May 13, 2014

[see edit!]

I'm getting a Segmentation fault when starting slider:

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `slider multimedia.pdf'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f7356ee92e4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
(gdb) bt full
#0 0x00007f7356ee92e4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#1 0x00007f7356eea65c in g_filename_from_uri ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#2 0x00007f735903cb7f in poppler_document_new_from_file ()
from /usr/lib/x86_64-linux-gnu/libpoppler-glib.so.8
No symbol table info available.
#3 0x0000000000406f58 in render ()
No symbol table info available.
#4 0x0000000000406c32 in render_init ()
No symbol table info available.
#5 0x0000000000402e4e in main ()
No symbol table info available.

Probably only marginally interesting: In the old version under Gnome3, once I went out of fullscreen mode (Ctrl+Tab) and back in (Ctrl+Tab), the fullscreen window did not cover the top bar any more (containing the clock etc).

EDIT: It works after a reboot! Not sure what happened there...

  1. Video is visible. In fact, the slider window gets minimized as soon as the video starts (and it stays minimized after the video has finished).
  2. I can see the Slider window now when I go to the overview of all windows (Windows-key in Gnome3) and I can see/work with other windows when I use Alt+Tab. However, as soon as the Slider window is not on top, it is minimized until it gets the focus again. As soon as it gets the focus, it goes back to complete fullscreen.
  3. Not working (or is it not supposed to work in-pdf with my Latex code?)
  4. Works; both versions of the Latex code give the same result for me.

Great progress!

So far tested with Gnome3 and no external monitor; I'll test with Metacity and an external monitor attached a bit later today.

@TrilbyWhite
Copy link
Owner

Thanks for the feedback - what is not working about 3? What happens when you play a video?

@thamnos
Copy link
Author

thamnos commented May 13, 2014

When I use my computer with Gnome3, no external monitor attached, a click on the video minimizes the slider window and the video plays in its original size (i.e. I can see my Desktop background and terminal, ... around the video).

However, my graphics card seems to be not able to cope with this mode and an external monitor, so I use a "GNOME Flashback (Metacity)" session when I want to attach an external monitor. In this case:

  1. The video is visible. In both Latex codes, the video plays in the pdf, not in fullscreen. When it ends, it leaves a black rectangle behind which then blends into the placeholder image.
  2. The slider presentation window is fullscreen all the time (Ctrl+Tab has no effect) and is visible in the list of windows.
  3. Again not sure if the video is supposed to play fullscreen or not -- it's not fullscreen, cf. (1).
  4. Works; both versions of the Latex code give the same result for me.

@TrilbyWhite
Copy link
Owner

I think I figured out why the window gets minimized. I'm just learning to use EWMH properly (I'm not really a fan, and don't use them in my WM). It seems something I was doing caused the WM to mark the window as minimized. I think I've resolved this and will push that code shortly.

For 3, I revised the default config so that playing in the proper 'frame' is the default. This can be changed to fullscreen by commenting the current mplayer line and uncommenting the other in the config file.

@thamnos
Copy link
Author

thamnos commented May 13, 2014

Switching between fullscreen and frame play-back in the config file works fine for me.
As per commit b51bc64 on my computer in Metacity, the video works as intended in both, fullscreen and 'frame' mode.
In gnome3 (without an external monitor attached), the presentation window is still minimised when a video starts to play and needs to be un-minimised manually. This happens in both, fullscreen and in-frame play-back.

@TrilbyWhite
Copy link
Owner

Odd, gnome 3 really did break compatibility with much other software. It seems it's hard to run any programs with gnome now unless they are built with gtk.

I did find some references to the new client messages they are using - and I implemented one that might prevent the window from being minimized, but I have no way of testing it here. I just pushed the revision if you wouldn't mind trying it out again.

@thamnos
Copy link
Author

thamnos commented May 13, 2014

That didn't do the trick I'm afraid...

@TrilbyWhite
Copy link
Owner

== Note Version 4 was pushed to 'master' today ==

While much of the above discussion it not be directly applicable to version 4, I'll keep this issue open as a couple of these concerns will reappear with version 4, and this thread can be a reminder of what needs to be checked back in on.

One notable regression is that for now only the one version of the latex code will work. The alternative approach can be expected to be coming soon to v4, but it's not here yet.

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

No branches or pull requests

2 participants