VLCJ and window without decorations

This forum is about all development around libVLC.
mnn
New Cone
New Cone
Posts: 6
Joined: 12 Oct 2008 15:22

VLCJ and window without decorations

Postby mnn » 11 Jul 2011 14:41

Hi, is it possible to have a window which contains panel, in which VLCJ plays a video, but having the window without decorations?

I tried using setUndecorated(true) on JFrame, but the video isn't rendered at all.

I tried using JWindow and still no video rendered at all.

Just a remainder: I don't want fullscreen - only decorationless window.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: VLCJ and window without decorations

Postby sherington » 11 Jul 2011 17:51

An undecorated, non-full-screen JFrame works just fine for me. The video plays without any problems. I use Ubuntu 11.04.

Post a single class test case of what doesn't work, and post your OS and vlc/vlcj versions.

mnn
New Cone
New Cone
Posts: 6
Joined: 12 Oct 2008 15:22

Re: VLCJ and window without decorations

Postby mnn » 11 Jul 2011 20:04

OK, I separated enough code to make a sample, but that works :(

Apparently VLCJ doesn't like if the video canvas is in a panel, which is located in another panel, and that panel is located in a JFrame (so JFrame -> JPanel -> JPanel -> Canvas (VLCJ)). I tried to cut one panel, and it works (without decorations).

Edit: The bug is (surprise, surprise) in Swing. When the JFrame is decorationless, inner panel (which contains Canvas) ignores all orders to set its sizes (setSize, setMinimumSize...), when they're called from JFrame's ComponentListener's componentResized first call (e.g. when JFrame is being shown).

By ignored I mean that the same calls make impact, when JFrame has decorations... but when it doesn't the JPanel has size of [0,0].

As always, Sun shows how "great" Swing is...

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: VLCJ and window without decorations

Postby sherington » 11 Jul 2011 20:32

Apparently VLCJ doesn't like if the video canvas is in a panel, which is located in another panel, and that panel is located in a JFrame (so JFrame -> JPanel -> JPanel -> Canvas (VLCJ)).

Edit: The bug is (surprise, surprise) in Swing. When the JFrame is decorationless, inner panel (which contains Canvas) ignores all orders to set its sizes (setSize, setMinimumSize...), when they're called from JFrame's ComponentListener's componentResized first call (e.g. when JFrame is being shown).

As always, Sun shows how "great" Swing is...
Hmm... I have "decorationless" JFrame -> JPanel (content Pane) -> JPanel -> JPanel -> Canvas (vlcj). Works just fine. I wouldn't be so quick to denigrate Sun engineers or Swing.

What OS are you using? Maybe it's a platform-specific bug, if you're sure it's not your bug... :D

mnn
New Cone
New Cone
Posts: 6
Joined: 12 Oct 2008 15:22

Re: VLCJ and window without decorations

Postby mnn » 12 Jul 2011 00:25

Hmm, OK, it might be Windows-specific bug, but I kind of doubt that.

I mean if I comment out line this.setUndecorated(true) in JFrame constructor, suddenly panel gets resized correctly. That sounds like a bug to me.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: VLCJ and window without decorations

Postby sherington » 12 Jul 2011 08:05

Well maybe you are triggering a bug. But I don't see that bug under the circumstances you describe, at least not on Linux.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 15 guests