Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
dimbor
nx-libs
Commits
337afd83
Commit
337afd83
authored
May 25, 2020
by
Ulrich Sibiller
Committed by
Mike Gabriel
Oct 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Events.c: add more DEBUG output
parent
8deda7bd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
8 deletions
+75
-8
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+75
-8
No files found.
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
337afd83
...
...
@@ -3135,8 +3135,26 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X)
return
1
;
}
#define DEBUG
#define TEST
int
nxagentHandleConfigureNotify
(
XEvent
*
X
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Event info:
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: X->serial [%ld]
\n
"
,
__func__
,
X
->
xconfigure
.
serial
);
fprintf
(
stderr
,
"%s: X->override_redirect [%d]
\n
"
,
__func__
,
X
->
xconfigure
.
override_redirect
);
fprintf
(
stderr
,
"%s: X->border_width [%d]
\n
"
,
__func__
,
X
->
xconfigure
.
border_width
);
fprintf
(
stderr
,
"%s: X->send_event [%d]
\n
"
,
__func__
,
X
->
xconfigure
.
send_event
);
fprintf
(
stderr
,
"%s: X->window [0x%lx]
\n
"
,
__func__
,
X
->
xconfigure
.
window
);
fprintf
(
stderr
,
"%s: X->event [0x%lx]
\n
"
,
__func__
,
X
->
xconfigure
.
event
);
fprintf
(
stderr
,
"%s: X->x, X->y [%d][%d]
\n
"
,
__func__
,
X
->
xconfigure
.
x
,
X
->
xconfigure
.
y
);
fprintf
(
stderr
,
"%s: X->width, X->height [%d][%d]
\n
"
,
__func__
,
X
->
xconfigure
.
width
,
X
->
xconfigure
.
height
);
fprintf
(
stderr
,
"%s: References:
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: DefaultWindow[0]: [0x%x]
\n
"
,
__func__
,
nxagentDefaultWindows
[
0
]);
fprintf
(
stderr
,
"%s: DefaultRootWindow(DISPLAY) [0x%lx]
\n
"
,
__func__
,
DefaultRootWindow
(
nxagentDisplay
));
#endif
if
(
nxagentOption
(
Rootless
)
==
True
)
{
int
sendEventAnyway
=
0
;
...
...
@@ -3326,6 +3344,10 @@ int nxagentHandleConfigureNotify(XEvent* X)
if
(
!
nxagentWMIsRunning
||
X
->
xconfigure
.
send_event
)
{
updatePos
=
True
;
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Accumulating event %d: x [%d] y [%d] width [%d] height [%d]
\n
"
,
__func__
,
count
,
X
->
xconfigure
.
x
,
X
->
xconfigure
.
y
,
X
->
xconfigure
.
width
,
X
->
xconfigure
.
height
);
#endif
newX
=
X
->
xconfigure
.
x
;
newY
=
X
->
xconfigure
.
y
;
}
...
...
@@ -3340,10 +3362,11 @@ int nxagentHandleConfigureNotify(XEvent* X)
}
}
if
(
updatePos
)
if
(
updatePos
&&
(
nxagentOption
(
X
)
!=
newX
||
nxagentOption
(
Y
)
!=
newY
)
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Updating nxagent window position [%d,%d]
\n
"
,
__func__
,
newX
,
newY
);
fprintf
(
stderr
,
"%s: Updating nxagent window position [%d,%d] -> [%d,%d]
\n
"
,
__func__
,
nxagentOption
(
X
),
nxagentOption
(
Y
),
newX
,
newY
);
#endif
nxagentChangeOption
(
X
,
newX
);
nxagentChangeOption
(
Y
,
newY
);
...
...
@@ -3356,8 +3379,16 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentShadowResize
=
1
;
}
if
(
nxagentOption
(
Width
)
!=
X
->
xconfigure
.
width
||
nxagentOption
(
Height
)
!=
X
->
xconfigure
.
height
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Updating width and height [%d,%d] -> [%d,%d]
\n
"
,
__func__
,
nxagentOption
(
Width
),
nxagentOption
(
Height
),
X
->
xconfigure
.
width
,
X
->
xconfigure
.
height
);
#endif
nxagentChangeOption
(
Width
,
X
->
xconfigure
.
width
);
nxagentChangeOption
(
Height
,
X
->
xconfigure
.
height
);
}
nxagentChangeOption
(
ViewportXSpan
,
(
int
)
X
->
xconfigure
.
width
-
(
int
)
nxagentOption
(
RootWidth
));
...
...
@@ -3378,9 +3409,6 @@ int nxagentHandleConfigureNotify(XEvent* X)
doRandR
=
False
;
}
nxagentChangeOption
(
Width
,
X
->
xconfigure
.
width
);
nxagentChangeOption
(
Height
,
X
->
xconfigure
.
height
);
XMoveResizeWindow
(
nxagentDisplay
,
nxagentInputWindows
[
0
],
0
,
0
,
X
->
xconfigure
.
width
,
X
->
xconfigure
.
height
);
...
...
@@ -3449,13 +3477,31 @@ int nxagentHandleConfigureNotify(XEvent* X)
}
}
#ifdef TEST
fprintf
(
stderr
,
"%s: received for unexpected window [%ld]
\n
"
,
__func__
,
X
->
xconfigure
.
window
);
#endif
return
0
;
}
int
nxagentHandleReparentNotify
(
XEvent
*
X
)
{
#ifdef TEST
fprintf
(
stderr
,
"%s: Going to handle a new reparent event.
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: Going to handle a new reparent event (serial [%ld].
\n
"
,
__func__
,
X
->
xreparent
.
serial
);
#endif
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Event info:
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: X->send_event [%d]
\n
"
,
__func__
,
X
->
xreparent
.
send_event
);
fprintf
(
stderr
,
"%s: X->event [0x%lx]
\n
"
,
__func__
,
X
->
xreparent
.
event
);
fprintf
(
stderr
,
"%s: X->window [0x%lx]
\n
"
,
__func__
,
X
->
xreparent
.
window
);
fprintf
(
stderr
,
"%s: X->parent [0x%lx]
\n
"
,
__func__
,
X
->
xreparent
.
parent
);
fprintf
(
stderr
,
"%s: X->x, X->y [%d][%d]
\n
"
,
__func__
,
X
->
xreparent
.
x
,
X
->
xreparent
.
y
);
fprintf
(
stderr
,
"%s: X->override_redirect [%d]
\n
"
,
__func__
,
X
->
xreparent
.
override_redirect
);
fprintf
(
stderr
,
"%s: References:
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: DefaultWindow[0]: [0x%x]
\n
"
,
__func__
,
nxagentDefaultWindows
[
0
]);
fprintf
(
stderr
,
"%s: RootWindow(DISPLAY, 0): [0x%lx]
\n
"
,
__func__
,
RootWindow
(
nxagentDisplay
,
0
));
fprintf
(
stderr
,
"%s: DefaultRootWindow(DISPLAY): [0x%lx]
\n
"
,
__func__
,
DefaultRootWindow
(
nxagentDisplay
));
#endif
if
(
nxagentOption
(
Rootless
))
...
...
@@ -3560,20 +3606,29 @@ int nxagentHandleReparentNotify(XEvent* X)
&
attributes
)
==
0
))
{
#ifdef WARNING
fprintf
(
stderr
,
"%s: WARNING! XGetWindowAttributes failed.
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: WARNING! XGetWindowAttributes f
or parent window f
ailed.
\n
"
,
__func__
);
#endif
return
1
;
}
XlibWindow
junk
;
int
x
=
attributes
.
x
;
int
y
=
attributes
.
y
;
XlibWindow
junk
;
#ifdef DEBUG
int
before_x
=
x
;
int
before_y
=
y
;
#endif
XTranslateCoordinates
(
nxagentDisplay
,
X
->
xreparent
.
window
,
attributes
.
root
,
-
attributes
.
border_width
,
-
attributes
.
border_width
,
&
x
,
&
y
,
&
junk
);
#ifdef DEBUG
fprintf
(
stderr
,
"%s: translated coordinates x,y [%d,%d] -> [%d,%d].
\n
"
,
__func__
,
before_x
,
before_y
,
x
,
y
);
#endif
/*
* Calculate the parent X and parent Y.
*/
...
...
@@ -3623,6 +3678,18 @@ int nxagentHandleReparentNotify(XEvent* X)
nxagentChangeOption
(
WMBorderWidth
,
(
x
-
attributes
.
x
));
nxagentChangeOption
(
WMTitleHeight
,
(
y
-
attributes
.
y
));
#ifdef DEBUG
fprintf
(
stderr
,
"%s: WMBorderWidth [%d]
\n
"
,
__func__
,
nxagentOption
(
WMBorderWidth
));
fprintf
(
stderr
,
"%s: WMTitleHeight [%d]
\n
"
,
__func__
,
nxagentOption
(
WMTitleHeight
));
fprintf
(
stderr
,
"%s: win_gravity [%d]
\n
"
,
__func__
,
attributes
.
win_gravity
);
fprintf
(
stderr
,
"%s: bit_gravity [%d]
\n
"
,
__func__
,
attributes
.
bit_gravity
);
fprintf
(
stderr
,
"%s: border_width [%d]
\n
"
,
__func__
,
attributes
.
border_width
);
fprintf
(
stderr
,
"%s: height [%d]
\n
"
,
__func__
,
attributes
.
height
);
fprintf
(
stderr
,
"%s: width [%d]
\n
"
,
__func__
,
attributes
.
width
);
fprintf
(
stderr
,
"%s: x [%d]
\n
"
,
__func__
,
attributes
.
x
);
fprintf
(
stderr
,
"%s: y [%d]
\n
"
,
__func__
,
attributes
.
y
);
#endif
}
}
...
...
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