Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
0cbc9445
Commit
0cbc9445
authored
Jan 13, 2002
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixed all the problems related to ToggleFullScreen().
parent
9cec4e85
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
310 additions
and
33 deletions
+310
-33
plugins/mga/xmga.c
plugins/mga/xmga.c
+150
-14
plugins/x11/xcommon.c
plugins/x11/xcommon.c
+154
-16
src/video_output/video_output.c
src/video_output/video_output.c
+6
-3
No files found.
plugins/mga/xmga.c
View file @
0cbc9445
...
...
@@ -2,7 +2,7 @@
* xmga.c : X11 MGA plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: xmga.c,v 1.
2 2002/01/10 04:11:25 sam
Exp $
* $Id: xmga.c,v 1.
3 2002/01/13 15:07:55 gbazin
Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
...
...
@@ -153,6 +153,10 @@ typedef struct vout_sys_s
int
i_height_backup
;
int
i_xpos_backup
;
int
i_ypos_backup
;
int
i_width_backup_2
;
int
i_height_backup_2
;
int
i_xpos_backup_2
;
int
i_ypos_backup_2
;
/* Screen saver properties */
int
i_ss_timeout
;
/* timeout */
...
...
@@ -974,6 +978,10 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
Atom
prop
;
mwmhints_t
mwmhints
;
int
i_xpos
,
i_ypos
,
i_width
,
i_height
;
XEvent
xevent
;
#ifdef ALTERNATE_FULLSCREEN
XSetWindowAttributes
attributes
;
#endif
p_vout
->
b_fullscreen
=
!
p_vout
->
b_fullscreen
;
...
...
@@ -985,10 +993,35 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
intf_WarnMsg
(
3
,
"vout: entering fullscreen mode"
);
/* Save current window coordinates so they can be restored when
* we exit from fullscreen mode */
* we exit from fullscreen mode. This is the tricky part because
* this heavily depends on the behaviour of the window manager.
* When you use XMoveWindow some window managers will adjust the top
* of the window to the coordinates you gave, but others will instead
* adjust the top of the client area to the coordinates
* (don't forget windows have decorations). */
/* First, get the position and size of the client area */
XGetGeometry
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
&
dummy1
,
&
dummy2
,
&
dummy3
,
&
p_vout
->
p_sys
->
i_width_backup_2
,
&
p_vout
->
p_sys
->
i_height_backup_2
,
&
dummy2
,
&
dummy3
);
XTranslateCoordinates
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
DefaultRootWindow
(
p_vout
->
p_sys
->
p_display
),
0
,
0
,
&
p_vout
->
p_sys
->
i_xpos_backup_2
,
&
p_vout
->
p_sys
->
i_ypos_backup_2
,
&
dummy1
);
/* find the real parent, which means the which is a direct child of
* the root window */
/* Then try to get the position and size of the whole window */
/* find the real parent of our window (created by the window manager),
* the one which is a direct child of the root window */
next_parent
=
parent
=
p_vout
->
p_sys
->
window
;
while
(
next_parent
!=
DefaultRootWindow
(
p_vout
->
p_sys
->
p_display
)
)
{
...
...
@@ -1020,9 +1053,7 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
&
p_vout
->
p_sys
->
i_ypos_backup
,
&
dummy1
);
mwmhints
.
flags
=
MWM_HINTS_DECORATIONS
;
mwmhints
.
decorations
=
0
;
/* fullscreen window size and position */
i_xpos
=
0
;
i_ypos
=
0
;
i_width
=
DisplayWidth
(
p_vout
->
p_sys
->
p_display
,
...
...
@@ -1042,9 +1073,6 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
{
intf_WarnMsg
(
3
,
"vout: leaving fullscreen mode"
);
mwmhints
.
flags
=
MWM_HINTS_DECORATIONS
;
mwmhints
.
decorations
=
1
;
i_xpos
=
p_vout
->
p_sys
->
i_xpos_backup
;
i_ypos
=
p_vout
->
p_sys
->
i_ypos_backup
;
i_width
=
p_vout
->
p_sys
->
i_width_backup
;
...
...
@@ -1057,15 +1085,20 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
* The other way is to use the motif property "_MOTIF_WM_HINTS" which
* luckily seems to be supported by most window managers.
*/
#ifndef ALTERNATE_FULLSCREEN
mwmhints
.
flags
=
MWM_HINTS_DECORATIONS
;
mwmhints
.
decorations
=
!
p_vout
->
b_fullscreen
;
prop
=
XInternAtom
(
p_vout
->
p_sys
->
p_display
,
"_MOTIF_WM_HINTS"
,
False
);
XChangeProperty
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
prop
,
prop
,
32
,
PropModeReplace
,
(
unsigned
char
*
)
&
mwmhints
,
PROP_MWM_HINTS_ELEMENTS
);
#if 0 /* brute force way to remove decorations */
XSetWindowAttributes attributes;
attributes.override_redirect = True;
#else
/* brute force way to remove decorations */
attributes
.
override_redirect
=
p_vout
->
b_fullscreen
;
XChangeWindowAttributes
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
CWOverrideRedirect
,
...
...
@@ -1075,14 +1108,117 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
/* We need to unmap and remap the window if we want the window
* manager to take our changes into effect */
XUnmapWindow
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
);
XWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
StructureNotifyMask
,
&
xevent
);
while
(
xevent
.
type
!=
UnmapNotify
)
XWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
StructureNotifyMask
,
&
xevent
);
XMapRaised
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
);
while
(
xevent
.
type
!=
MapNotify
)
XWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
StructureNotifyMask
,
&
xevent
);
XMoveResizeWindow
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
i_xpos
,
i_ypos
,
i_width
,
i_height
);
XSync
(
p_vout
->
p_sys
->
p_display
,
False
);
/* Purge all ConfigureNotify events, this is needed to fix a bug where we
* would lose the original size of the window */
while
(
xevent
.
type
!=
ConfigureNotify
)
XWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
StructureNotifyMask
,
&
xevent
);
while
(
XCheckWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
StructureNotifyMask
,
&
xevent
)
);
/* We need to check that the window was really restored where we wanted */
if
(
!
p_vout
->
b_fullscreen
)
{
Window
dummy1
;
unsigned
int
dummy2
,
dummy3
,
dummy4
,
dummy5
;
/* Check the position */
XTranslateCoordinates
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
DefaultRootWindow
(
p_vout
->
p_sys
->
p_display
),
0
,
0
,
&
dummy2
,
&
dummy3
,
&
dummy1
);
if
(
dummy2
!=
p_vout
->
p_sys
->
i_xpos_backup_2
||
dummy3
!=
p_vout
->
p_sys
->
i_ypos_backup_2
)
{
/* Ok it didn't work... second try */
XMoveWindow
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
p_vout
->
p_sys
->
i_xpos_backup_2
,
p_vout
->
p_sys
->
i_ypos_backup_2
);
/* Purge all ConfigureNotify events, this is needed to fix a bug
* where we would lose the original size of the window */
XWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
StructureNotifyMask
,
&
xevent
);
while
(
xevent
.
type
!=
ConfigureNotify
)
XWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
StructureNotifyMask
,
&
xevent
);
while
(
XCheckWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
StructureNotifyMask
,
&
xevent
)
);
}
/* Check the size */
XGetGeometry
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
&
dummy1
,
&
dummy2
,
&
dummy3
,
&
dummy4
,
&
dummy5
,
&
dummy2
,
&
dummy3
);
if
(
dummy4
!=
p_vout
->
p_sys
->
i_width_backup_2
||
dummy5
!=
p_vout
->
p_sys
->
i_height_backup_2
)
{
/* Ok it didn't work... third try */
XResizeWindow
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
p_vout
->
p_sys
->
i_width_backup_2
,
p_vout
->
p_sys
->
i_height_backup_2
);
/* Purge all ConfigureNotify events, this is needed to fix a bug
* where we would lose the original size of the window */
XWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
StructureNotifyMask
,
&
xevent
);
while
(
xevent
.
type
!=
ConfigureNotify
)
XWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
StructureNotifyMask
,
&
xevent
);
while
(
XCheckWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
StructureNotifyMask
,
&
xevent
)
);
}
}
#ifdef ALTERNATE_FULLSCREEN
XSetInputFocus
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
window
,
RevertToParent
,
CurrentTime
);
#endif
/* signal that the size needs to be updated */
p_vout
->
p_sys
->
i_width
=
i_width
;
p_vout
->
p_sys
->
i_height
=
i_height
;
p_vout
->
i_changes
|=
VOUT_SIZE_CHANGE
;
}
/*****************************************************************************
...
...
plugins/x11/xcommon.c
View file @
0cbc9445
This diff is collapsed.
Click to expand it.
src/video_output/video_output.c
View file @
0cbc9445
...
...
@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.15
6 2002/01/12 01:25:57 sam
Exp $
* $Id: video_output.c,v 1.15
7 2002/01/13 15:07:55 gbazin
Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
...
...
@@ -172,10 +172,13 @@ vout_thread_t * vout_CreateThread ( int *pi_status,
p_vout
->
b_info
=
0
;
p_vout
->
b_interface
=
0
;
p_vout
->
b_scale
=
1
;
p_vout
->
b_fullscreen
=
main_GetIntVariable
(
VOUT_FULLSCREEN_VAR
,
VOUT_FULLSCREEN_DEFAULT
);
p_vout
->
b_fullscreen
=
0
;
p_vout
->
render_time
=
10
;
/* user requested fullscreen? */
if
(
main_GetIntVariable
(
VOUT_FULLSCREEN_VAR
,
VOUT_FULLSCREEN_DEFAULT
)
)
p_vout
->
i_changes
|=
VOUT_FULLSCREEN_CHANGE
;
/* Create thread and set locks */
vlc_mutex_init
(
&
p_vout
->
picture_lock
);
vlc_mutex_init
(
&
p_vout
->
subpicture_lock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment