Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
b60cbd56
Commit
b60cbd56
authored
Jul 14, 2010
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Much better debugging of property changes
parent
c62b2a59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
38 deletions
+59
-38
SDL_x11events.c
src/video/x11/SDL_x11events.c
+59
-34
SDL_x11window.c
src/video/x11/SDL_x11window.c
+0
-4
No files found.
src/video/x11/SDL_x11events.c
View file @
b60cbd56
...
@@ -292,51 +292,77 @@ X11_DispatchEvent(_THIS)
...
@@ -292,51 +292,77 @@ X11_DispatchEvent(_THIS)
case
PropertyNotify
:{
case
PropertyNotify
:{
#ifdef DEBUG_XEVENTS
#ifdef DEBUG_XEVENTS
unsigned
char
*
propdata
;
int
status
,
real_format
;
Atom
real_type
;
unsigned
long
items_read
,
items_left
,
i
;
char
*
name
=
XGetAtomName
(
display
,
xevent
.
xproperty
.
atom
);
char
*
name
=
XGetAtomName
(
display
,
xevent
.
xproperty
.
atom
);
printf
(
"PropertyNotify (atom = %s)
\n
"
,
name
?
name
:
"NULL"
);
if
(
name
)
{
if
(
name
)
{
printf
(
"PropertyNotify: %s
\n
"
,
name
);
XFree
(
name
);
XFree
(
name
);
}
}
#endif
if
(
xevent
.
xproperty
.
atom
==
videodata
->
_NET_WM_STATE
)
{
unsigned
char
*
propdata
;
int
status
,
real_format
;
Atom
real_type
;
unsigned
long
items_read
,
items_left
,
i
;
#ifdef DEBUG_XEVENTS
status
=
XGetWindowProperty
(
display
,
data
->
xwindow
,
xevent
.
xproperty
.
atom
,
0L
,
8192L
,
False
,
AnyPropertyType
,
&
real_type
,
&
real_format
,
&
items_read
,
&
items_left
,
&
propdata
);
printf
(
"_NET_WM_STATE: {"
);
if
(
status
==
Success
)
{
#endif
if
(
real_type
==
XA_INTEGER
)
{
status
=
XGetWindowProperty
(
display
,
data
->
xwindow
,
videodata
->
_NET_WM_STATE
,
0L
,
8192L
,
False
,
XA_ATOM
,
&
real_type
,
&
real_format
,
&
items_read
,
&
items_left
,
&
propdata
)
;
int
*
values
=
(
int
*
)
propdata
;
if
(
status
==
Success
)
{
Atom
*
atoms
=
(
Atom
*
)
propdata
;
printf
(
"{"
)
;
for
(
i
=
0
;
i
<
items_read
;
i
++
)
{
for
(
i
=
0
;
i
<
items_read
;
i
++
)
{
if
(
atoms
[
i
]
==
videodata
->
_NET_WM_STATE_HIDDEN
)
{
printf
(
" %d"
,
values
[
i
]);
#ifdef DEBUG_XEVENTS
}
printf
(
" _NET_WM_STATE_HIDDEN"
);
printf
(
" }
\n
"
);
#endif
}
else
if
(
real_type
==
XA_CARDINAL
)
{
if
(
real_format
==
32
)
{
Uint32
*
values
=
(
Uint32
*
)
propdata
;
printf
(
"{"
);
for
(
i
=
0
;
i
<
items_read
;
i
++
)
{
printf
(
" %d"
,
values
[
i
]);
}
}
if
(
atoms
[
i
]
==
videodata
->
_NET_WM_STATE_MAXIMIZED_HORZ
)
{
printf
(
" }
\n
"
);
#ifdef DEBUG_XEVENTS
}
else
if
(
real_format
==
16
)
{
printf
(
" _NET_WM_STATE_MAXIMIZED_HORZ"
);
Uint16
*
values
=
(
Uint16
*
)
propdata
;
#endif
printf
(
"{"
);
for
(
i
=
0
;
i
<
items_read
;
i
++
)
{
printf
(
" %d"
,
values
[
i
]);
}
}
if
(
atoms
[
i
]
==
videodata
->
_NET_WM_STATE_MAXIMIZED_VERT
)
{
printf
(
" }
\n
"
);
#ifdef DEBUG_XEVENTS
}
else
if
(
real_format
==
8
)
{
printf
(
" _NET_WM_STATE_MAXIMIZED_VERT"
);
Uint8
*
values
=
(
Uint8
*
)
propdata
;
#endif
printf
(
"{"
);
for
(
i
=
0
;
i
<
items_read
;
i
++
)
{
printf
(
" %d"
,
values
[
i
]);
}
}
if
(
atoms
[
i
]
==
videodata
->
_NET_WM_STATE_FULLSCREEN
)
{
printf
(
" }
\n
"
);
#ifdef DEBUG_XEVENTS
}
printf
(
" _NET_WM_STATE_FULLSCREEN"
);
}
else
if
(
real_type
==
XA_STRING
||
#endif
real_type
==
videodata
->
UTF8_STRING
)
{
printf
(
"{
\"
%s
\"
}
\n
"
,
propdata
);
}
else
if
(
real_type
==
XA_ATOM
)
{
Atom
*
atoms
=
(
Atom
*
)
propdata
;
printf
(
"{"
);
for
(
i
=
0
;
i
<
items_read
;
i
++
)
{
char
*
name
=
XGetAtomName
(
display
,
atoms
[
i
]);
if
(
name
)
{
printf
(
" %s"
,
name
);
XFree
(
name
);
}
}
}
}
printf
(
" }
\n
"
);
}
else
{
char
*
name
=
XGetAtomName
(
display
,
real_type
);
printf
(
"Unknown type: %ld (%s)
\n
"
,
real_type
,
name
?
name
:
"UNKNOWN"
);
if
(
name
)
{
XFree
(
name
);
}
}
}
#ifdef DEBUG_XEVENTS
printf
(
" }
\n
"
);
#endif
}
}
#endif
}
}
break
;
break
;
...
@@ -355,8 +381,7 @@ X11_DispatchEvent(_THIS)
...
@@ -355,8 +381,7 @@ X11_DispatchEvent(_THIS)
req
->
requestor
,
req
->
target
);
req
->
requestor
,
req
->
target
);
#endif
#endif
sevent
.
xselection
.
type
=
SelectionNotify
;
sevent
.
xany
.
type
=
SelectionNotify
;
sevent
.
xselection
.
display
=
req
->
display
;
sevent
.
xselection
.
selection
=
req
->
selection
;
sevent
.
xselection
.
selection
=
req
->
selection
;
sevent
.
xselection
.
target
=
None
;
sevent
.
xselection
.
target
=
None
;
sevent
.
xselection
.
property
=
None
;
sevent
.
xselection
.
property
=
None
;
...
...
src/video/x11/SDL_x11window.c
View file @
b60cbd56
...
@@ -682,8 +682,6 @@ X11_CreateWindow(_THIS, SDL_Window * window)
...
@@ -682,8 +682,6 @@ X11_CreateWindow(_THIS, SDL_Window * window)
XEvent
e
;
XEvent
e
;
e
.
xany
.
type
=
ClientMessage
;
e
.
xany
.
type
=
ClientMessage
;
e
.
xclient
.
display
=
data
->
display
;
e
.
xclient
.
window
=
w
;
e
.
xclient
.
message_type
=
_NET_WM_STATE
;
e
.
xclient
.
message_type
=
_NET_WM_STATE
;
e
.
xclient
.
format
=
32
;
e
.
xclient
.
format
=
32
;
e
.
xclient
.
data
.
l
[
0
]
=
_NET_WM_STATE_ADD
;
e
.
xclient
.
data
.
l
[
0
]
=
_NET_WM_STATE_ADD
;
...
@@ -955,8 +953,6 @@ X11_SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized)
...
@@ -955,8 +953,6 @@ X11_SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized)
XEvent
e
;
XEvent
e
;
e
.
xany
.
type
=
ClientMessage
;
e
.
xany
.
type
=
ClientMessage
;
e
.
xclient
.
display
=
display
;
e
.
xclient
.
window
=
data
->
xwindow
;
e
.
xclient
.
message_type
=
_NET_WM_STATE
;
e
.
xclient
.
message_type
=
_NET_WM_STATE
;
e
.
xclient
.
format
=
32
;
e
.
xclient
.
format
=
32
;
e
.
xclient
.
data
.
l
[
0
]
=
e
.
xclient
.
data
.
l
[
0
]
=
...
...
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