/*****************************************************************************
* x11_loop.cpp
*****************************************************************************
- * Copyright (C) 2003 VideoLAN
- * $Id: x11_loop.cpp,v 1.2 2004/01/18 00:25:02 asmax Exp $
+ * Copyright (C) 2003 VideoLAN (Centrale Réseaux) and its contributors
+ * $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
#include "x11_factory.hpp"
#include "x11_timer.hpp"
#include "../src/generic_window.hpp"
+#include "../src/theme.hpp"
+#include "../src/window_manager.hpp"
#include "../events/evt_focus.hpp"
#include "../events/evt_key.hpp"
#include "../events/evt_mouse.hpp"
#include "../events/evt_refresh.hpp"
#include "../events/evt_scroll.hpp"
#include "../commands/async_queue.hpp"
+#include "../utils/var_bool.hpp"
#include "vlc_keys.h"
// Wait for the next timer and execute it
// The sleep is interrupted if an X11 event is received
- pTimerLoop->waitNextTimer();
+ if( !m_exit )
+ {
+ pTimerLoop->waitNextTimer();
+ }
}
}
}
-void X11Loop::flush()
-{
- XFlush( XDISPLAY );
-}
-
-
void X11Loop::handleX11Event()
{
XEvent event;
// Look for the next event in the queue
XNextEvent( XDISPLAY, &event );
+ if( event.xany.window == m_rDisplay.getMainWindow() )
+ {
+ if( event.type == MapNotify )
+ {
+ // When the "parent" window is mapped, show all the visible
+ // windows, as it is not automatic, unfortunately
+ Theme *pTheme = getIntf()->p_sys->p_theme;
+ if( pTheme )
+ {
+ pTheme->getWindowManager().synchVisibility();
+ }
+ }
+ return;
+ }
+
// Find the window to which the event is sent
- X11Factory *pFactory = (X11Factory*)X11Factory::instance( getIntf() );
- GenericWindow *pWin = pFactory->m_windowMap[event.xany.window];
+ GenericWindow *pWin =
+ ((X11Factory*)pOsFactory)->m_windowMap[event.xany.window];
if( !pWin )
{
string type = XGetAtomName( XDISPLAY, event.xclient.message_type );
// Find the DnD object for this window
- X11DragDrop *pDnd = pFactory->m_dndMap[event.xany.window];
+ X11DragDrop *pDnd =
+ ((X11Factory*)pOsFactory)->m_dndMap[event.xany.window];
if( !pDnd )
{
msg_Err( getIntf(), "No associated D&D object !!" );
}
break;
}
-
- default:
- // XXX
- fprintf(stderr, "unknown event: %d\n", event.type );
- break;
}
}