You are not logged in.

#1 2020-10-30 23:38:28

Michael Gruenstaeudl
Member
Registered: 2014-12-03
Posts: 51

Overlaying webcam video on fullscreen mode of PDF viewer

I am using Xfce4 on Arch and would like to display my webcam video stream (e.g., via guvcview) in the upper right-hand corner on top of the fullscreen mode of a PDF viewer (e.g., PDF-XChange).
Do you have any recommendations on how to do that?

Offline

#2 2020-10-31 09:12:12

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,652

Re: Overlaying webcam video on fullscreen mode of PDF viewer

https://specifications.freedesktop.org/ … CKINGORDER

If xfwm4 correctly™ implements that (the behavior is not fully defined and a regular bug in WMs) and you want to have the pdf viewer active, you'd have the video to be recognized as WM_TRANSIENT_FOR the pdf viewer but since xprop doesn't support seting WINDOW type properties, you'd need some specilaized code, eg.

// gcc -o settransient -lX11 settransient.c

#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>

int main(int argc, char **argv)
{
    if (argc < 3) {
        fprintf(stderr, "Usage: %s <decimal main window ID> <decimal transient window ID>\n\
        eg. use \"xwininfo -wm -int\" to obtain the IDs\n", argv[0]);
        return 1;
    }
    Display *dpy;
    dpy = XOpenDisplay(NULL);
    if (!dpy) {
        fprintf(stderr, "Cannot open display.\n");
        return 1;
    }
    Window main = atoi(argv[1]);
    Window transient = atoi(argv[2]);
    XSetTransientForHint(dpy, transient, main);
    XCloseDisplay(dpy);
    return 0;
}

nb. that a side effect is that you should™ not be able to close the pdf viewer as long as the video window exists, some input to the video might be redirected and in worst case the input to the pdf viewer will be blocked by the WM.

In doubt you'll have to maximize the pdf viewer and set it below other windows…

Offline

Board footer

Powered by FluxBB