зеркало из https://github.com/mozilla/gecko-dev.git
Changes for qnx/photon only. They should not affect building/runtime other platforms.
Added MakeFullScreen() to properly set/restore the window's decorations for fullscreen/normal mode.
This commit is contained in:
Родитель
0f02f17c6c
Коммит
9de2a6d37e
|
@ -973,3 +973,39 @@ NS_IMETHODIMP nsWindow::SetFocus(PRBool aRaise)
|
|||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWindow::MakeFullScreen(PRBool aFullScreen)
|
||||
{
|
||||
/* we can use static data here because there can be only one full-screen window at a time */
|
||||
static unsigned short old_render_flags;
|
||||
static PhPoint_t old_pos;
|
||||
|
||||
PtArg_t args[3];
|
||||
|
||||
if( aFullScreen ) {
|
||||
unsigned short p, *pflags;
|
||||
PhArea_t area;
|
||||
|
||||
PtSetArg( &args[0], Pt_ARG_WINDOW_RENDER_FLAGS, &pflags, 0 );
|
||||
PtGetResources( mWidget, 1, args );
|
||||
p = old_render_flags = *pflags; // save the render flags
|
||||
p &= ~(Ph_WM_RENDER_TITLE|Ph_WM_RENDER_BORDER);
|
||||
|
||||
PtWidgetArea( mWidget, &area );
|
||||
old_pos = area.pos;
|
||||
|
||||
QueryVisible( );
|
||||
PtSetArg( &args[0], Pt_ARG_POS, &gConsoleRect.ul, 0 );
|
||||
PtSetArg( &args[1], Pt_ARG_WINDOW_RENDER_FLAGS, p, -1 );
|
||||
PtSetArg( &args[2], Pt_ARG_WINDOW_STATE, Ph_WM_STATE_ISFRONT, Ph_WM_STATE_ISFRONT );
|
||||
PtSetResources( mWidget, 3, args );
|
||||
}
|
||||
else {
|
||||
PtSetArg( &args[0], Pt_ARG_POS, &old_pos, 0 );
|
||||
PtSetArg( &args[1], Pt_ARG_WINDOW_RENDER_FLAGS, old_render_flags, -1 ); /* restore the render flags to the previous value */
|
||||
PtSetArg( &args[2], Pt_ARG_WINDOW_STATE, Ph_WM_STATE_ISNORMAL, Ph_WM_STATE_ISFRONT|Ph_WM_STATE_ISNORMAL );
|
||||
PtSetResources( mWidget, 3, args );
|
||||
}
|
||||
|
||||
return nsBaseWidget::MakeFullScreen( aFullScreen );
|
||||
}
|
||||
|
|
|
@ -124,6 +124,7 @@ public:
|
|||
}
|
||||
|
||||
NS_IMETHOD SetModal(PRBool aModal);
|
||||
NS_IMETHOD MakeFullScreen(PRBool aFullScreen);
|
||||
|
||||
// Native draw function... like doPaint()
|
||||
static void RawDrawFunc( PtWidget_t *pWidget, PhTile_t *damage );
|
||||
|
|
Загрузка…
Ссылка в новой задаче