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
be3c3a52
Commit
be3c3a52
authored
Sep 12, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Driver-side implementation of SetLayeredWindowAttributes.
Based on a patch by Rob Shearman.
parent
9fb76ddd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
0 deletions
+52
-0
window.c
dlls/winex11.drv/window.c
+49
-0
winex11.drv.spec
dlls/winex11.drv/winex11.drv.spec
+1
-0
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
x11drv_main.c
dlls/winex11.drv/x11drv_main.c
+1
-0
No files found.
dlls/winex11.drv/window.c
View file @
be3c3a52
...
@@ -382,6 +382,28 @@ static void sync_window_region( Display *display, struct x11drv_win_data *data,
...
@@ -382,6 +382,28 @@ static void sync_window_region( Display *display, struct x11drv_win_data *data,
/***********************************************************************
/***********************************************************************
* sync_window_opacity
*/
static
void
sync_window_opacity
(
Display
*
display
,
Window
win
,
COLORREF
key
,
BYTE
alpha
,
DWORD
flags
)
{
unsigned
long
opacity
=
0xffffffff
;
if
(
flags
&
LWA_ALPHA
)
opacity
=
(
0xffffffff
/
0xff
)
*
alpha
;
if
(
flags
&
LWA_COLORKEY
)
FIXME
(
"LWA_COLORKEY not supported
\n
"
);
wine_tsx11_lock
();
if
(
opacity
==
0xffffffff
)
XDeleteProperty
(
display
,
win
,
x11drv_atom
(
_NET_WM_WINDOW_OPACITY
)
);
else
XChangeProperty
(
display
,
win
,
x11drv_atom
(
_NET_WM_WINDOW_OPACITY
),
XA_CARDINAL
,
32
,
PropModeReplace
,
(
unsigned
char
*
)
&
opacity
,
1
);
wine_tsx11_unlock
();
}
/***********************************************************************
* sync_window_text
* sync_window_text
*/
*/
static
void
sync_window_text
(
Display
*
display
,
Window
win
,
const
WCHAR
*
text
)
static
void
sync_window_text
(
Display
*
display
,
Window
win
,
const
WCHAR
*
text
)
...
@@ -1340,6 +1362,9 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
...
@@ -1340,6 +1362,9 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
int
cx
,
cy
,
mask
;
int
cx
,
cy
,
mask
;
XSetWindowAttributes
attr
;
XSetWindowAttributes
attr
;
WCHAR
text
[
1024
];
WCHAR
text
[
1024
];
COLORREF
key
;
BYTE
alpha
;
DWORD
layered_flags
;
if
(
!
(
cx
=
data
->
window_rect
.
right
-
data
->
window_rect
.
left
))
cx
=
1
;
if
(
!
(
cx
=
data
->
window_rect
.
right
-
data
->
window_rect
.
left
))
cx
=
1
;
if
(
!
(
cy
=
data
->
window_rect
.
bottom
-
data
->
window_rect
.
top
))
cy
=
1
;
if
(
!
(
cy
=
data
->
window_rect
.
bottom
-
data
->
window_rect
.
top
))
cy
=
1
;
...
@@ -1389,6 +1414,10 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
...
@@ -1389,6 +1414,10 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat
/* set the window region */
/* set the window region */
sync_window_region
(
display
,
data
,
(
HRGN
)
1
);
sync_window_region
(
display
,
data
,
(
HRGN
)
1
);
/* set the window opacity */
if
(
!
GetLayeredWindowAttributes
(
data
->
hwnd
,
&
key
,
&
alpha
,
&
layered_flags
))
layered_flags
=
0
;
sync_window_opacity
(
display
,
data
->
whole_window
,
key
,
alpha
,
layered_flags
);
wine_tsx11_lock
();
wine_tsx11_lock
();
XFlush
(
display
);
/* make sure the window exists before we start painting to it */
XFlush
(
display
);
/* make sure the window exists before we start painting to it */
wine_tsx11_unlock
();
wine_tsx11_unlock
();
...
@@ -1488,6 +1517,13 @@ void X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
...
@@ -1488,6 +1517,13 @@ void X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
wine_tsx11_unlock
();
wine_tsx11_unlock
();
}
}
}
}
if
(
offset
==
GWL_EXSTYLE
&&
(
changed
&
WS_EX_LAYERED
))
{
/* changing WS_EX_LAYERED resets attributes */
if
((
data
=
X11DRV_get_win_data
(
hwnd
))
&&
data
->
whole_window
)
sync_window_opacity
(
thread_display
(),
data
->
whole_window
,
0
,
0
,
0
);
}
}
}
...
@@ -2158,6 +2194,19 @@ int X11DRV_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
...
@@ -2158,6 +2194,19 @@ int X11DRV_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
}
}
/***********************************************************************
* SetLayeredWindowAttributes (X11DRV.@)
*
* Set transparency attributes for a layered window.
*/
void
X11DRV_SetLayeredWindowAttributes
(
HWND
hwnd
,
COLORREF
key
,
BYTE
alpha
,
DWORD
flags
)
{
Window
win
=
X11DRV_get_whole_window
(
hwnd
);
if
(
win
)
sync_window_opacity
(
thread_display
(),
win
,
key
,
alpha
,
flags
);
}
/**********************************************************************
/**********************************************************************
* X11DRV_WindowMessage (X11DRV.@)
* X11DRV_WindowMessage (X11DRV.@)
*/
*/
...
...
dlls/winex11.drv/winex11.drv.spec
View file @
be3c3a52
...
@@ -106,6 +106,7 @@
...
@@ -106,6 +106,7 @@
@ cdecl SetClipboardData(long long long long) X11DRV_SetClipboardData
@ cdecl SetClipboardData(long long long long) X11DRV_SetClipboardData
@ cdecl SetCapture(long long) X11DRV_SetCapture
@ cdecl SetCapture(long long) X11DRV_SetCapture
@ cdecl SetFocus(long) X11DRV_SetFocus
@ cdecl SetFocus(long) X11DRV_SetFocus
@ cdecl SetLayeredWindowAttributes(long long long long) X11DRV_SetLayeredWindowAttributes
@ cdecl SetParent(long long long) X11DRV_SetParent
@ cdecl SetParent(long long long) X11DRV_SetParent
@ cdecl SetWindowIcon(long long long) X11DRV_SetWindowIcon
@ cdecl SetWindowIcon(long long long) X11DRV_SetWindowIcon
@ cdecl SetWindowRgn(long long long) X11DRV_SetWindowRgn
@ cdecl SetWindowRgn(long long long) X11DRV_SetWindowRgn
...
...
dlls/winex11.drv/x11drv.h
View file @
be3c3a52
...
@@ -609,6 +609,7 @@ enum x11drv_atoms
...
@@ -609,6 +609,7 @@ enum x11drv_atoms
XATOM__NET_WM_STATE_MAXIMIZED_VERT
,
XATOM__NET_WM_STATE_MAXIMIZED_VERT
,
XATOM__NET_WM_STATE_SKIP_PAGER
,
XATOM__NET_WM_STATE_SKIP_PAGER
,
XATOM__NET_WM_STATE_SKIP_TASKBAR
,
XATOM__NET_WM_STATE_SKIP_TASKBAR
,
XATOM__NET_WM_WINDOW_OPACITY
,
XATOM__NET_WM_WINDOW_TYPE
,
XATOM__NET_WM_WINDOW_TYPE
,
XATOM__NET_WM_WINDOW_TYPE_DIALOG
,
XATOM__NET_WM_WINDOW_TYPE_DIALOG
,
XATOM__NET_WM_WINDOW_TYPE_NORMAL
,
XATOM__NET_WM_WINDOW_TYPE_NORMAL
,
...
...
dlls/winex11.drv/x11drv_main.c
View file @
be3c3a52
...
@@ -145,6 +145,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
...
@@ -145,6 +145,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
"_NET_WM_STATE_MAXIMIZED_VERT"
,
"_NET_WM_STATE_MAXIMIZED_VERT"
,
"_NET_WM_STATE_SKIP_PAGER"
,
"_NET_WM_STATE_SKIP_PAGER"
,
"_NET_WM_STATE_SKIP_TASKBAR"
,
"_NET_WM_STATE_SKIP_TASKBAR"
,
"_NET_WM_WINDOW_OPACITY"
,
"_NET_WM_WINDOW_TYPE"
,
"_NET_WM_WINDOW_TYPE"
,
"_NET_WM_WINDOW_TYPE_DIALOG"
,
"_NET_WM_WINDOW_TYPE_DIALOG"
,
"_NET_WM_WINDOW_TYPE_NORMAL"
,
"_NET_WM_WINDOW_TYPE_NORMAL"
,
...
...
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