Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5a5344b4
Commit
5a5344b4
authored
Feb 27, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Added tracking of the WM_STATE window property.
parent
9939b7b4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
13 deletions
+47
-13
event.c
dlls/winex11.drv/event.c
+43
-12
window.c
dlls/winex11.drv/window.c
+1
-1
x11drv.h
dlls/winex11.drv/x11drv.h
+2
-0
x11drv_main.c
dlls/winex11.drv/x11drv_main.c
+1
-0
No files found.
dlls/winex11.drv/event.c
View file @
5a5344b4
...
...
@@ -583,33 +583,64 @@ static void EVENT_FocusOut( HWND hwnd, XEvent *xev )
/***********************************************************************
* get_window_wm_state
*/
int
get_window_wm_state
(
Display
*
display
,
struct
x11drv_win_data
*
data
)
{
struct
{
CARD32
state
;
XID
icon
;
}
*
state
;
Atom
type
;
int
format
,
ret
=
-
1
;
unsigned
long
count
,
remaining
;
wine_tsx11_lock
();
if
(
!
XGetWindowProperty
(
display
,
data
->
whole_window
,
x11drv_atom
(
WM_STATE
),
0
,
sizeof
(
*
state
)
/
sizeof
(
CARD32
),
False
,
x11drv_atom
(
WM_STATE
),
&
type
,
&
format
,
&
count
,
&
remaining
,
(
unsigned
char
**
)
&
state
))
{
if
(
type
==
x11drv_atom
(
WM_STATE
)
&&
format
&&
count
>=
sizeof
(
*
state
)
/
(
format
/
8
))
ret
=
state
->
state
;
XFree
(
state
);
}
wine_tsx11_unlock
();
return
ret
;
}
/***********************************************************************
* EVENT_PropertyNotify
* We use this to release resources like Pixmaps when a selection
* client no longer needs them.
*/
static
void
EVENT_PropertyNotify
(
HWND
hwnd
,
XEvent
*
xev
)
{
XPropertyEvent
*
event
=
&
xev
->
xproperty
;
/* Check if we have any resources to free */
TRACE
(
"Received PropertyNotify event:
\n
"
);
struct
x11drv_win_data
*
data
;
if
(
!
hwnd
)
return
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
;
switch
(
event
->
state
)
{
case
PropertyDelete
:
if
(
event
->
atom
==
x11drv_atom
(
WM_STATE
))
{
TRACE
(
"
\t
PropertyDelete for atom %ld on window %ld
\n
"
,
event
->
atom
,
(
long
)
event
->
window
);
break
;
data
->
wm_state
=
WithdrawnState
;
TRACE
(
"%p/%lx: WM_STATE deleted
\n
"
,
data
->
hwnd
,
data
->
whole_window
);
}
break
;
case
PropertyNewValue
:
if
(
event
->
atom
==
x11drv_atom
(
WM_STATE
))
{
TRACE
(
"
\t
PropertyNewValue for atom %ld on window %ld
\n\n
"
,
event
->
atom
,
(
long
)
event
->
window
);
break
;
int
new_state
=
get_window_wm_state
(
event
->
display
,
data
);
if
(
new_state
!=
-
1
&&
new_state
!=
data
->
wm_state
)
{
TRACE
(
"%p/%lx: new WM_STATE %d
\n
"
,
data
->
hwnd
,
data
->
whole_window
,
new_state
);
data
->
wm_state
=
new_state
;
}
}
default:
break
;
}
}
...
...
dlls/winex11.drv/window.c
View file @
5a5344b4
...
...
@@ -200,7 +200,7 @@ static int get_window_attributes( Display *display, struct x11drv_win_data *data
attr
->
event_mask
=
(
ExposureMask
|
PointerMotionMask
|
ButtonPressMask
|
ButtonReleaseMask
|
EnterWindowMask
|
KeyPressMask
|
KeyReleaseMask
|
FocusChangeMask
|
KeymapStateMask
);
if
(
data
->
managed
)
attr
->
event_mask
|=
StructureNotifyMask
;
if
(
data
->
managed
)
attr
->
event_mask
|=
StructureNotifyMask
|
PropertyChangeMask
;
return
(
CWOverrideRedirect
|
CWSaveUnder
|
CWColormap
|
CWCursor
|
CWEventMask
|
CWBitGravity
|
CWBackingStore
);
...
...
dlls/winex11.drv/x11drv.h
View file @
5a5344b4
...
...
@@ -559,6 +559,7 @@ enum x11drv_atoms
XATOM_RAW_CAP_HEIGHT
,
XATOM_WM_PROTOCOLS
,
XATOM_WM_DELETE_WINDOW
,
XATOM_WM_STATE
,
XATOM_WM_TAKE_FOCUS
,
XATOM_KWM_DOCKWINDOW
,
XATOM_DndProtocol
,
...
...
@@ -669,6 +670,7 @@ struct x11drv_win_data
XWMHints
*
wm_hints
;
/* window manager hints */
BOOL
managed
:
1
;
/* is window managed? */
BOOL
mapped
:
1
;
/* is window mapped? (in either normal or iconic state) */
int
wm_state
;
/* current value of the WM_STATE property */
DWORD
net_wm_state
;
/* bit mask of active x11drv_net_wm_state values */
unsigned
int
lock_changes
;
/* lock count for X11 change requests */
HBITMAP
hWMIconBitmap
;
...
...
dlls/winex11.drv/x11drv_main.c
View file @
5a5344b4
...
...
@@ -123,6 +123,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
"RAW_CAP_HEIGHT"
,
"WM_PROTOCOLS"
,
"WM_DELETE_WINDOW"
,
"WM_STATE"
,
"WM_TAKE_FOCUS"
,
"KWM_DOCKWINDOW"
,
"DndProtocol"
,
...
...
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