use an accessor for SystemEnvData::aWindow
with an eye to making it on-demand Change-Id: If6cefd68a336dc6afe23591c857bd71034215b54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109929 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -880,7 +880,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co
|
||||
g_object_set(G_OBJECT(mpPlaybin), "video-sink", pVideosink, nullptr);
|
||||
g_object_set(G_OBJECT(mpPlaybin), "force-aspect-ratio", FALSE, nullptr);
|
||||
|
||||
mnWindowID = pEnvData->aWindow;
|
||||
mnWindowID = pEnvData->GetWindowHandle();
|
||||
mpDisplay = pEnvData->pDisplay;
|
||||
SAL_INFO( "avmedia.gstreamer", AVVERSION "set window id to " << static_cast<int>(mnWindowID) << " XOverlay " << mpXOverlay);
|
||||
gst_element_set_state( mpPlaybin, GST_STATE_PAUSED );
|
||||
|
||||
+15
-2
@@ -61,7 +61,6 @@ struct SystemEnvData
|
||||
enum class Platform { Wayland, Xcb };
|
||||
|
||||
void* pDisplay; // the relevant display connection
|
||||
sal_uIntPtr aWindow; // the window of the object
|
||||
void* pSalFrame; // contains a salframe, if object has one
|
||||
void* pWidget; // the corresponding widget
|
||||
void* pVisual; // the visual in use
|
||||
@@ -71,6 +70,20 @@ struct SystemEnvData
|
||||
sal_IntPtr aShellWindow; // the window of the frame's shell
|
||||
Toolkit toolkit; // the toolkit in use
|
||||
Platform platform; // the windowing system in use
|
||||
private:
|
||||
sal_uIntPtr aWindow; // the window of the object
|
||||
public:
|
||||
|
||||
void SetWindowHandle(sal_uIntPtr nWindow)
|
||||
{
|
||||
aWindow = nWindow;
|
||||
}
|
||||
|
||||
sal_uIntPtr GetWindowHandle() const
|
||||
{
|
||||
return aWindow;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
SystemEnvData()
|
||||
@@ -83,7 +96,6 @@ struct SystemEnvData
|
||||
#elif defined( IOS )
|
||||
#elif defined( UNX )
|
||||
: pDisplay(nullptr)
|
||||
, aWindow(0)
|
||||
, pSalFrame(nullptr)
|
||||
, pWidget(nullptr)
|
||||
, pVisual(nullptr)
|
||||
@@ -91,6 +103,7 @@ struct SystemEnvData
|
||||
, aShellWindow(0)
|
||||
, toolkit(Toolkit())
|
||||
, platform(Platform())
|
||||
, aWindow(0)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ css::uno::Any VCLXSystemDependentWindow::getWindowHandle( const css::uno::Sequen
|
||||
{
|
||||
css::awt::SystemDependentXWindow aSD;
|
||||
aSD.DisplayPointer = sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(pSysData->pDisplay));
|
||||
aSD.WindowHandle = pSysData->aWindow;
|
||||
aSD.WindowHandle = pSysData->GetWindowHandle();
|
||||
aRet <<= aSD;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,7 @@ css::uno::Any VCLXTopWindow::getWindowHandle( const css::uno::Sequence< sal_Int8
|
||||
{
|
||||
css::awt::SystemDependentXWindow aSD;
|
||||
aSD.DisplayPointer = sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(pSysData->pDisplay));
|
||||
aSD.WindowHandle = pSysData->aWindow;
|
||||
aSD.WindowHandle = pSysData->GetWindowHandle();
|
||||
aRet <<= aSD;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -844,7 +844,7 @@ void SAL_CALL Qt5FilePicker::initialize(const uno::Sequence<uno::Any>& args)
|
||||
const auto it
|
||||
= std::find_if(pFrames.begin(), pFrames.end(), [&aWindowHandle](auto pFrame) -> bool {
|
||||
const SystemEnvData* pData = pFrame->GetSystemData();
|
||||
return pData && tools::Long(pData->aWindow) == aWindowHandle;
|
||||
return pData && tools::Long(pData->GetWindowHandle()) == aWindowHandle;
|
||||
});
|
||||
if (it != pFrames.end())
|
||||
m_pParentWidget = static_cast<Qt5Frame*>(*it)->asChild();
|
||||
|
||||
@@ -185,7 +185,7 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
|
||||
// s. tdf#122293/QTBUG-75766
|
||||
const bool bWayland = QGuiApplication::platformName() == "wayland";
|
||||
if (!bWayland)
|
||||
m_aSystemData.aWindow = m_pQWidget->winId();
|
||||
m_aSystemData.SetWindowHandle(m_pQWidget->winId());
|
||||
else
|
||||
{
|
||||
// TODO implement as needed for Wayland,
|
||||
|
||||
@@ -51,7 +51,7 @@ Qt5Object::Qt5Object(Qt5Frame* pParent, bool bShow)
|
||||
if (!bWayland)
|
||||
{
|
||||
m_aSystemData.platform = SystemEnvData::Platform::Xcb;
|
||||
m_aSystemData.aWindow = m_pQWindow->winId(); // ID of the embedded window
|
||||
m_aSystemData.SetWindowHandle(m_pQWindow->winId()); // ID of the embedded window
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -227,7 +227,7 @@ SystemWindowData X11OpenGLContext::generateWinData(vcl::Window* pParent, bool /*
|
||||
const SystemEnvData* sysData(pParent->GetSystemData());
|
||||
|
||||
Display *dpy = static_cast<Display*>(sysData->pDisplay);
|
||||
Window win = sysData->aWindow;
|
||||
Window win = sysData->GetWindowHandle();
|
||||
|
||||
if( dpy == nullptr || !glXQueryExtension( dpy, nullptr, nullptr ) )
|
||||
return aWinData;
|
||||
@@ -472,7 +472,7 @@ void X11OpenGLContext::initWindow()
|
||||
InitChildWindow(m_pChildWindow.get());
|
||||
|
||||
m_aGLWin.dpy = static_cast<Display*>(pChildSysData->pDisplay);
|
||||
m_aGLWin.win = pChildSysData->aWindow;
|
||||
m_aGLWin.win = pChildSysData->GetWindowHandle();
|
||||
m_aGLWin.screen = pChildSysData->nScreen;
|
||||
|
||||
Visual* pVisual = static_cast<Visual*>(pChildSysData->pVisual);
|
||||
|
||||
@@ -173,7 +173,7 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle() const
|
||||
#elif defined IOS
|
||||
// Nothing
|
||||
#elif defined UNX
|
||||
nRet = GetSystemData()->aWindow;
|
||||
nRet = GetSystemData()->GetWindowHandle();
|
||||
#endif
|
||||
|
||||
return nRet;
|
||||
|
||||
@@ -164,7 +164,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) :
|
||||
{
|
||||
const SystemEnvData* pEnv = pFrame->GetSystemData();
|
||||
::Window aClientWindow = pEnv->aShellWindow;
|
||||
::Window aFocusWindow = pEnv->aWindow;
|
||||
::Window aFocusWindow = pEnv->GetWindowHandle();
|
||||
|
||||
// for status callbacks and commit string callbacks
|
||||
#define PREEDIT_BUFSZ 16
|
||||
@@ -548,7 +548,7 @@ SalI18N_InputContext::SetICFocus( SalFrame* pFocusFrame )
|
||||
|
||||
const SystemEnvData* pEnv = pFocusFrame->GetSystemData();
|
||||
::Window aClientWindow = pEnv->aShellWindow;
|
||||
::Window aFocusWindow = pEnv->aWindow;
|
||||
::Window aFocusWindow = pEnv->GetWindowHandle();
|
||||
|
||||
XSetICValues( maContext,
|
||||
XNFocusWindow, aFocusWindow,
|
||||
|
||||
@@ -1849,7 +1849,7 @@ int SalDisplay::CaptureMouse( SalFrame *pCapture )
|
||||
if( !pEnv || !*pEnv )
|
||||
{
|
||||
int ret = XGrabPointer( GetDisplay(),
|
||||
static_cast<::Window>(pEnvData->aWindow),
|
||||
static_cast<::Window>(pEnvData->GetWindowHandle()),
|
||||
False,
|
||||
PointerMotionMask| ButtonPressMask|ButtonReleaseMask,
|
||||
GrabModeAsync,
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace cairo
|
||||
|
||||
X11SysData::X11SysData( const SystemEnvData& pSysDat ) :
|
||||
pDisplay(pSysDat.pDisplay),
|
||||
hDrawable(pSysDat.aWindow),
|
||||
hDrawable(pSysDat.GetWindowHandle()),
|
||||
pVisual(pSysDat.pVisual),
|
||||
nScreen(pSysDat.nScreen),
|
||||
pRenderFormat(nullptr)
|
||||
|
||||
@@ -51,7 +51,7 @@ void X11SalGraphics::YieldGraphicsExpose()
|
||||
for (auto pSalFrame : vcl_sal::getSalDisplay(GetGenericUnixSalData())->getFrames() )
|
||||
{
|
||||
const SystemEnvData* pEnvData = pSalFrame->GetSystemData();
|
||||
if( Drawable(pEnvData->aWindow) == aWindow )
|
||||
if( Drawable(pEnvData->GetWindowHandle()) == aWindow )
|
||||
{
|
||||
pFrame = pSalFrame;
|
||||
break;
|
||||
|
||||
@@ -947,7 +947,7 @@ const SystemEnvData* X11SalFrame::GetSystemData() const
|
||||
{
|
||||
X11SalFrame *pFrame = const_cast<X11SalFrame*>(this);
|
||||
pFrame->maSystemChildData.pDisplay = GetXDisplay();
|
||||
pFrame->maSystemChildData.aWindow = pFrame->GetWindow();
|
||||
pFrame->maSystemChildData.SetWindowHandle(pFrame->GetWindow());
|
||||
pFrame->maSystemChildData.pSalFrame = pFrame;
|
||||
pFrame->maSystemChildData.pWidget = nullptr;
|
||||
pFrame->maSystemChildData.pVisual = GetDisplay()->GetVisual( m_nXScreen ).GetVisual();
|
||||
|
||||
@@ -62,7 +62,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
|
||||
SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericUnixSalData());
|
||||
const SystemEnvData* pEnv = pParent->GetSystemData();
|
||||
Display* pDisp = pSalDisp->GetDisplay();
|
||||
::Window aObjectParent = static_cast<::Window>(pEnv->aWindow);
|
||||
::Window aObjectParent = static_cast<::Window>(pEnv->GetWindowHandle());
|
||||
pObject->maParentWin = aObjectParent;
|
||||
|
||||
// find out on which screen that window is
|
||||
@@ -157,7 +157,7 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p
|
||||
}
|
||||
|
||||
pObjData->pDisplay = pDisp;
|
||||
pObjData->aWindow = pObject->maSecondary;
|
||||
pObjData->SetWindowHandle(pObject->maSecondary);
|
||||
pObjData->pWidget = nullptr;
|
||||
pObjData->pVisual = pVisual;
|
||||
|
||||
@@ -224,7 +224,7 @@ X11SalObject::X11SalObject()
|
||||
, mbVisible(false)
|
||||
{
|
||||
maSystemChildData.pDisplay = vcl_sal::getSalDisplay(GetGenericUnixSalData())->GetDisplay();
|
||||
maSystemChildData.aWindow = None;
|
||||
maSystemChildData.SetWindowHandle(None);
|
||||
maSystemChildData.pSalFrame = nullptr;
|
||||
maSystemChildData.pWidget = nullptr;
|
||||
maSystemChildData.pVisual = nullptr;
|
||||
@@ -332,7 +332,7 @@ X11SalObject::SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, to
|
||||
void
|
||||
X11SalObject::Show( bool bVisible )
|
||||
{
|
||||
if ( ! maSystemChildData.aWindow )
|
||||
if (!maSystemChildData.GetWindowHandle())
|
||||
return;
|
||||
|
||||
if ( bVisible ) {
|
||||
@@ -353,7 +353,7 @@ void X11SalObject::GrabFocus()
|
||||
{
|
||||
if( mbVisible )
|
||||
XSetInputFocus( static_cast<Display*>(maSystemChildData.pDisplay),
|
||||
maSystemChildData.aWindow,
|
||||
maSystemChildData.GetWindowHandle(),
|
||||
RevertToNone,
|
||||
CurrentTime );
|
||||
}
|
||||
|
||||
@@ -782,7 +782,7 @@ GtkWidget* GtkSalDisplay::findGtkWidgetForNativeHandle(sal_uIntPtr hWindow) cons
|
||||
for (auto pSalFrame : m_aFrames )
|
||||
{
|
||||
const SystemEnvData* pEnvData = pSalFrame->GetSystemData();
|
||||
if (pEnvData->aWindow == hWindow)
|
||||
if (pEnvData->GetWindowHandle() == hWindow)
|
||||
return GTK_WIDGET(pEnvData->pWidget);
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
@@ -950,7 +950,7 @@ void GtkSalFrame::InitCommon()
|
||||
gtk_widget_realize( m_pWindow );
|
||||
|
||||
//system data
|
||||
m_aSystemData.aWindow = GetNativeWindowHandle(m_pWindow);
|
||||
m_aSystemData.SetWindowHandle(GetNativeWindowHandle(m_pWindow));
|
||||
m_aSystemData.aShellWindow = reinterpret_cast<sal_IntPtr>(this);
|
||||
m_aSystemData.pSalFrame = this;
|
||||
m_aSystemData.pWidget = m_pWindow;
|
||||
|
||||
@@ -65,7 +65,7 @@ void GtkSalObjectBase::Init()
|
||||
gtk_widget_realize( m_pSocket );
|
||||
|
||||
// system data
|
||||
m_aSystemData.aWindow = m_pParent->GetNativeWindowHandle(m_pSocket);
|
||||
m_aSystemData.SetWindowHandle(m_pParent->GetNativeWindowHandle(m_pSocket));
|
||||
m_aSystemData.aShellWindow = reinterpret_cast<sal_IntPtr>(this);
|
||||
m_aSystemData.pSalFrame = nullptr;
|
||||
m_aSystemData.pWidget = m_pSocket;
|
||||
|
||||
Reference in New Issue
Block a user