Commit 39491099 authored by Cyril Deguet's avatar Cyril Deguet

* x11_display.cpp: create a dummy "parent" window for the task bar

  * x11_window.cpp: use XSetTransientForHint() to associate the windows
  to the "parent" window -> single window in the task bar
parent dacc4c15
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
X11Display::X11Display( intf_thread_t *pIntf ): SkinObject( pIntf ), X11Display::X11Display( intf_thread_t *pIntf ): SkinObject( pIntf ),
m_gc( NULL ), m_colormap( 0 ) m_mainWindow( 0 ), m_gc( NULL ), m_colormap( 0 )
{ {
// Open a connection to the X Server // Open a connection to the X Server
m_pDisplay = XOpenDisplay( NULL ); m_pDisplay = XOpenDisplay( NULL );
...@@ -181,11 +181,46 @@ X11Display::X11Display( intf_thread_t *pIntf ): SkinObject( pIntf ), ...@@ -181,11 +181,46 @@ X11Display::X11Display( intf_thread_t *pIntf ): SkinObject( pIntf ),
m_gc = XCreateGC( m_pDisplay, DefaultRootWindow( m_pDisplay ), m_gc = XCreateGC( m_pDisplay, DefaultRootWindow( m_pDisplay ),
GCGraphicsExposures, &xgcvalues ); GCGraphicsExposures, &xgcvalues );
} }
// Create a parent window to have a single task in the task bar
XSetWindowAttributes attr;
m_mainWindow = XCreateWindow( m_pDisplay, DefaultRootWindow( m_pDisplay),
0, 0, 1, 1, 0, 0, InputOutput,
CopyFromParent, 0, &attr );
// Changing decorations
struct {
unsigned long flags;
unsigned long functions;
unsigned long decorations;
long input_mode;
unsigned long status;
} motifWmHints;
Atom hints_atom = XInternAtom( m_pDisplay, "_MOTIF_WM_HINTS", False );
motifWmHints.flags = 2; // MWM_HINTS_DECORATIONS;
motifWmHints.decorations = 0;
XChangeProperty( m_pDisplay, m_mainWindow, hints_atom, hints_atom, 32,
PropModeReplace, (unsigned char *)&motifWmHints,
sizeof( motifWmHints ) / sizeof( long ) );
// Change the window title
XStoreName( m_pDisplay, m_mainWindow, "VLC Media Player" );
// Set an empty mask for the window
Region mask = XCreateRegion();
XShapeCombineRegion( m_pDisplay, m_mainWindow, ShapeBounding, 0, 0, mask,
ShapeSet );
// Map the window
XMapWindow( m_pDisplay, m_mainWindow);
} }
X11Display::~X11Display() X11Display::~X11Display()
{ {
if( m_mainWindow )
{
XDestroyWindow( m_pDisplay, m_mainWindow );
}
if( m_gc ) if( m_gc )
{ {
XFreeGC( m_pDisplay, m_gc ); XFreeGC( m_pDisplay, m_gc );
......
...@@ -68,10 +68,15 @@ class X11Display: public SkinObject ...@@ -68,10 +68,15 @@ class X11Display: public SkinObject
/// Get the pixel value corresponding to the given colors /// Get the pixel value corresponding to the given colors
unsigned long getPixelValue( uint8_t r, uint8_t g, uint8_t b ) const; unsigned long getPixelValue( uint8_t r, uint8_t g, uint8_t b ) const;
/// Get the main window ID
Window getMainWindow() const { return m_mainWindow; }
//XXX //XXX
Window m_voutWindow; Window m_voutWindow;
private: private:
/// Dummy parent window for the task bar
Window m_mainWindow;
/// Display parameters /// Display parameters
Display *m_pDisplay; Display *m_pDisplay;
Visual *m_pVisual; Visual *m_pVisual;
...@@ -82,7 +87,6 @@ class X11Display: public SkinObject ...@@ -82,7 +87,6 @@ class X11Display: public SkinObject
int m_greenLeftShift, m_greenRightShift; int m_greenLeftShift, m_greenRightShift;
int m_blueLeftShift, m_blueRightShift; int m_blueLeftShift, m_blueRightShift;
/// Pointer on the right implementation of getPixel /// Pointer on the right implementation of getPixel
MakePixelFunc_t makePixelImpl; MakePixelFunc_t makePixelImpl;
......
...@@ -101,9 +101,12 @@ X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow, ...@@ -101,9 +101,12 @@ X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
pFactory->m_dndMap[m_wnd] = m_pDropTarget; pFactory->m_dndMap[m_wnd] = m_pDropTarget;
} }
// Change the window title XXX // Change the window title
XStoreName( XDISPLAY, m_wnd, "VLC" ); XStoreName( XDISPLAY, m_wnd, "VLC" );
// Associate the window to the main "parent" window
XSetTransientForHint( XDISPLAY, m_wnd, m_rDisplay.getMainWindow() );
// XXX Kludge to tell VLC that this window is the vout // XXX Kludge to tell VLC that this window is the vout
if (pParentWindow) if (pParentWindow)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment