Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
395928df
Commit
395928df
authored
Jan 23, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Apply the existing window region (if any) when creating the whole window.
Move X11DRV_SetWindowRgn to window.c.
parent
9fc4e5f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
56 deletions
+71
-56
window.c
dlls/winex11.drv/window.c
+71
-0
winpos.c
dlls/winex11.drv/winpos.c
+0
-56
No files found.
dlls/winex11.drv/window.c
View file @
395928df
...
...
@@ -32,6 +32,9 @@
#include <X11/Xlib.h>
#include <X11/Xresource.h>
#include <X11/Xutil.h>
#ifdef HAVE_LIBXSHAPE
#include <X11/extensions/shape.h>
#endif
/* HAVE_LIBXSHAPE */
#include "windef.h"
#include "winbase.h"
...
...
@@ -222,6 +225,41 @@ void X11DRV_sync_window_style( Display *display, struct x11drv_win_data *data )
/***********************************************************************
* sync_window_region
*
* Update the X11 window region.
*/
static
void
sync_window_region
(
Display
*
display
,
struct
x11drv_win_data
*
data
,
HRGN
hrgn
)
{
#ifdef HAVE_LIBXSHAPE
if
(
!
data
->
whole_window
)
return
;
if
(
!
hrgn
)
{
wine_tsx11_lock
();
XShapeCombineMask
(
display
,
data
->
whole_window
,
ShapeBounding
,
0
,
0
,
None
,
ShapeSet
);
wine_tsx11_unlock
();
}
else
{
RGNDATA
*
pRegionData
=
X11DRV_GetRegionData
(
hrgn
,
0
);
if
(
pRegionData
)
{
wine_tsx11_lock
();
XShapeCombineRectangles
(
display
,
data
->
whole_window
,
ShapeBounding
,
data
->
window_rect
.
left
-
data
->
whole_rect
.
left
,
data
->
window_rect
.
top
-
data
->
whole_rect
.
top
,
(
XRectangle
*
)
pRegionData
->
Buffer
,
pRegionData
->
rdh
.
nCount
,
ShapeSet
,
YXBanded
);
wine_tsx11_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
pRegionData
);
}
}
#endif
/* HAVE_LIBXSHAPE */
}
/***********************************************************************
* X11DRV_set_win_format
*/
BOOL
X11DRV_set_win_format
(
HWND
hwnd
,
XID
fbconfig_id
)
...
...
@@ -1013,6 +1051,7 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
int
cx
,
cy
,
mask
;
XSetWindowAttributes
attr
;
XIM
xim
;
HRGN
hrgn
;
if
(
!
(
cx
=
data
->
window_rect
.
right
-
data
->
window_rect
.
left
))
cx
=
1
;
if
(
!
(
cy
=
data
->
window_rect
.
bottom
-
data
->
window_rect
.
top
))
cy
=
1
;
...
...
@@ -1051,6 +1090,13 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
X11DRV_set_wm_hints
(
display
,
data
);
SetPropA
(
data
->
hwnd
,
whole_window_prop
,
(
HANDLE
)
data
->
whole_window
);
/* set the window region */
if
((
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
{
if
(
GetWindowRgn
(
data
->
hwnd
,
hrgn
)
!=
ERROR
)
sync_window_region
(
display
,
data
,
hrgn
);
DeleteObject
(
hrgn
);
}
return
data
->
whole_window
;
}
...
...
@@ -1619,3 +1665,28 @@ void X11DRV_SetWindowIcon( HWND hwnd, UINT type, HICON icon )
wine_tsx11_unlock
();
}
}
/***********************************************************************
* SetWindowRgn (X11DRV.@)
*
* Assign specified region to window (for non-rectangular windows)
*/
int
X11DRV_SetWindowRgn
(
HWND
hwnd
,
HRGN
hrgn
,
BOOL
redraw
)
{
struct
x11drv_win_data
*
data
;
if
((
data
=
X11DRV_get_win_data
(
hwnd
)))
{
sync_window_region
(
thread_display
(),
data
,
hrgn
);
invalidate_dce
(
hwnd
,
&
data
->
window_rect
);
}
else
if
(
GetWindowThreadProcessId
(
hwnd
,
NULL
)
!=
GetCurrentThreadId
())
{
FIXME
(
"not supported on other thread window %p
\n
"
,
hwnd
);
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
FALSE
;
}
return
TRUE
;
}
dlls/winex11.drv/winpos.c
View file @
395928df
...
...
@@ -23,9 +23,6 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef HAVE_LIBXSHAPE
#include <X11/extensions/shape.h>
#endif
/* HAVE_LIBXSHAPE */
#include <stdarg.h>
#include "windef.h"
...
...
@@ -1029,59 +1026,6 @@ void X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev )
/***********************************************************************
* SetWindowRgn (X11DRV.@)
*
* Assign specified region to window (for non-rectangular windows)
*/
int
X11DRV_SetWindowRgn
(
HWND
hwnd
,
HRGN
hrgn
,
BOOL
redraw
)
{
struct
x11drv_win_data
*
data
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
{
if
(
IsWindow
(
hwnd
))
FIXME
(
"not supported on other thread window %p
\n
"
,
hwnd
);
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
FALSE
;
}
#ifdef HAVE_LIBXSHAPE
if
(
data
->
whole_window
)
{
Display
*
display
=
thread_display
();
if
(
!
hrgn
)
{
wine_tsx11_lock
();
XShapeCombineMask
(
display
,
data
->
whole_window
,
ShapeBounding
,
0
,
0
,
None
,
ShapeSet
);
wine_tsx11_unlock
();
}
else
{
RGNDATA
*
pRegionData
=
X11DRV_GetRegionData
(
hrgn
,
0
);
if
(
pRegionData
)
{
wine_tsx11_lock
();
XShapeCombineRectangles
(
display
,
data
->
whole_window
,
ShapeBounding
,
data
->
window_rect
.
left
-
data
->
whole_rect
.
left
,
data
->
window_rect
.
top
-
data
->
whole_rect
.
top
,
(
XRectangle
*
)
pRegionData
->
Buffer
,
pRegionData
->
rdh
.
nCount
,
ShapeSet
,
YXBanded
);
wine_tsx11_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
pRegionData
);
}
}
}
#endif
/* HAVE_LIBXSHAPE */
invalidate_dce
(
hwnd
,
&
data
->
window_rect
);
return
TRUE
;
}
/***********************************************************************
* draw_moving_frame
*
* Draw the frame used when moving or resizing window.
...
...
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