Page 1 of 1

How to stop VLC window position from changing in Openbox? (Solved)

Posted: Tue Apr 27, 2021 4:55 am
by dr__Dan

I've noticed that VLC Media Player has unusual behavior when windowed: When I close it and reopen it, its y position goes up by the thickness of the titlebar. It continues to move with every closure and reopening, until the titlebar is hidden, after which it stops rising. I've noticed it on multiple computers and at least a few versions of Fatdog 64, but the internet didn't have any info that I could find on the matter, let alone a setting to adjust to prevent it. Does anyone have a solution? Is it Fatdog64-related? I don't particularly use other systems, so I can't easily test for the same behavior elsewhere.

Thanks,

Dan


Re: VLC window position question

Posted: Tue Apr 27, 2021 5:30 am
by amethyst
dr__Dan wrote: Tue Apr 27, 2021 4:55 am

I've noticed that VLC Media Player has unusual behavior when windowed: When I close it and reopen it, its y position goes up by the thickness of the titlebar. It continues to move with every closure and reopening, until the titlebar is hidden, after which it stops rising. I've noticed it on multiple computers and at least a few versions of Fatdog 64, but the internet didn't have any info that I could find on the matter, let alone a setting to adjust to prevent it. Does anyone have a solution? Is it Fatdog64-related? I don't particularly use other systems, so I can't easily test for the same behavior elsewhere.

Thanks,

Dan

Don't know if this is related but I have noticed that VLC's resume function sometimes messes up the original windows position. So, one would start a video and if you watched part of it before, a message will show at the top to ask whether you want to resume from a previous position. If you click one of the options, this windows re-positioning may occur. Set the video setting in VLC preferences to 'Always on top' and see if you have the same issues.


Re: How to stop VLC window position from changing?

Posted: Tue Apr 27, 2021 1:01 pm
by Flash

This behavior isn't limited to VLC. I've noticed it when using other apps, including ROX-filer and different consoles and terminals. Perhaps it's done by JWM?


Re: How to stop VLC window position from changing?

Posted: Tue Apr 27, 2021 1:10 pm
by taersh

I also think it's JWM.
The window of Retrovol mixer shows the same behavior.


Re: How to stop VLC window position from changing?

Posted: Wed Apr 28, 2021 4:33 am
by Flash

I'm pretty sure I remember a thread in the old forum discussing this and how to prevent it.


Re: How to stop VLC window position from changing?

Posted: Wed Apr 28, 2021 6:15 am
by gychang
dr__Dan wrote: Tue Apr 27, 2021 4:55 am

I've noticed that VLC Media Player has unusual behavior when windowed: When I close it and reopen it, its y position goes up by the thickness of the titlebar. It continues to move with every closure and reopening, until the titlebar is hidden, after which it stops rising. I've noticed it on multiple computers and at least a few versions of Fatdog 64, but the internet didn't have any info that I could find on the matter, let alone a setting to adjust to prevent it. Does anyone have a solution? Is it Fatdog64-related? I don't particularly use other systems, so I can't easily test for the same behavior elsewhere.

Thanks,

Dan

modifying the jwm behavior may help. On my fossapup64, adding

<Group>
<Name>vlc</Name>
<Option>x:0</Option>
<Option>y:0</Option>
</Group>

to /etc/xdg/templates/_root_.jwmrc and restarting jwm or rebooting, will place it on left upper corner. Change the x / y values to change placement to your liking.


Re: How to stop VLC window position from changing?

Posted: Wed Apr 28, 2021 9:24 pm
by step

I think Dan uses openbox (Fatdog64 carries JVM too as an option).


Re: How to stop VLC window position from changing?

Posted: Fri Apr 30, 2021 3:04 am
by dr__Dan

step is correct, it is happening using Openbox. I haven't noticed it on any other program, but I don't open and close most programs as often as I do VLC, and who looks for such things anyway? Has anyone else reproduced this? I wouldn't really care, but my wife wants to have an "X" to click on to close a window, not any alternative method for closing one.

@gychang: Thanks, I'll try to find a corresponding setting for Openbox. There appears to be a global setting, but I'll try to see about a program-specific option.

Dan


Re: How to stop VLC window position from changing?

Posted: Fri Apr 30, 2021 8:47 pm
by step

@dr__Dan, look at /etc/xdg/openbox/rc.xml near line 589. There's a long comment that teaches how to do window-specific hacks. Copy the system file to ~/.config/openbox/rc.xml and edit your copy. Run openbox --reconfigure in a terminal to apply a change. Search the web for "openbox rc.xml" to find more examples.


Re: How to stop VLC window position from changing?

Posted: Sat May 01, 2021 4:19 am
by dr__Dan

@step, thanks, that's likely going to take care of it. Is there any evident cause for the VLC behavior I've mentioned?

Dan


Re: How to stop VLC window position from changing in Openbox? (Solved)

Posted: Sat May 01, 2021 9:40 pm
by step

I don't know. Occasionally something like that happens to me with LibreOffice and even with a commercial application. Libre is based on GTK2; VLC and the commercial application on Qt5 (the commercial app runs on its own Qt5 libraries). What to make of this information? Anyway, my work-around is manual: with the off-screen window in focus I press Alt-space, M (for move), the down-arrow key a few times then ENTER. Even quicker, if you don't mind maximizing, is Alt-space X. Another thing you could try is changing the defaultmediaplayer handler to always start VLC maximized. Create file ~/.fatdog/defaultprograms and add this line:

Code: Select all

DEF_MEDIAPLAYER="vlc --fullscreen"

and reboot. This setting will apply to when vlc is started from rox (clicking a video icon) and the application menu.

Mind that in fullscreen mode there is no window title bar, so you'll see the menu bar directly below the top screen edge. If you want to always start in non-fullscreen mode replace --fullscreen with --no-fullscreen. By the way, VLC seems to remember the fullscreen setting, so if you close it once in fullscreen mode then start it again from a terminal window with no options (vlc), it should start in fullscreen mode, that is, without window title bar.


Re: How to stop VLC window position from changing in Openbox? (Solved)

Posted: Fri May 07, 2021 6:12 am
by dr__Dan

Well, neither method worked. I tried changing /etc/xdg/openbox/rc.xml to set y to 'center', '30', and '-30', and x to 'center', but got the same behavior. I also tried editing ~/.fatdog/defaultprograms as described for automatic 'no-fullscreen' operation, but it had no apparent effect. I don't want fullscreen or maximized. It has been my experience that VLC remembers window details, and the window size it opens with is consistent, only the y position gets shifted.


Re: How to stop VLC window position from changing in Openbox? (Solved)

Posted: Thu May 27, 2021 3:07 am
by dr__Dan

After a little consulting with @step, this is the solution that did the trick, placed in the <applications>...</applications> section of ~/.config/openbox/rc.xml

Code: Select all

     <application name="vlc">
      <position force="yes">
        <x>center</x>
        <y>30</y>
      </position>
    </application>
 

The side effect is that VLC doesn't seem to want to go straight to fullscreen when I launch an optical video disc, but for me, since I use it as much for playing audio as video, it is an adequate trade-off.

Dan