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
e2421bbd
Commit
e2421bbd
authored
Oct 27, 2018
by
Ulrich Sibiller
Committed by
Mike Gabriel
Oct 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Window.c: use C99 designated initializers at some places
parent
728a3d1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
37 deletions
+30
-37
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+30
-37
No files found.
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
e2421bbd
...
@@ -232,10 +232,7 @@ static int nxagentFindWindowMatch(WindowPtr pWin, void * ptr)
...
@@ -232,10 +232,7 @@ static int nxagentFindWindowMatch(WindowPtr pWin, void * ptr)
WindowPtr
nxagentWindowPtr
(
Window
window
)
WindowPtr
nxagentWindowPtr
(
Window
window
)
{
{
WindowMatchRec
match
;
WindowMatchRec
match
=
{.
pWin
=
NullWindow
,
.
id
=
window
};
match
.
pWin
=
NullWindow
;
match
.
id
=
window
;
for
(
int
i
=
0
;
i
<
nxagentNumScreens
;
i
++
)
for
(
int
i
=
0
;
i
<
nxagentNumScreens
;
i
++
)
{
{
...
@@ -716,8 +713,6 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
...
@@ -716,8 +713,6 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
void
nxagentSwitchFullscreen
(
ScreenPtr
pScreen
,
Bool
switchOn
)
void
nxagentSwitchFullscreen
(
ScreenPtr
pScreen
,
Bool
switchOn
)
{
{
XEvent
e
=
{
0
};
if
(
nxagentOption
(
Rootless
)
==
1
)
if
(
nxagentOption
(
Rootless
)
==
1
)
{
{
return
;
return
;
...
@@ -754,14 +749,15 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
...
@@ -754,14 +749,15 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
nxagentChangeOption
(
Fullscreen
,
switchOn
);
nxagentChangeOption
(
Fullscreen
,
switchOn
);
e
.
xclient
.
type
=
ClientMessage
;
XEvent
e
=
{
e
.
xclient
.
message_type
=
nxagentAtoms
[
13
];
/* _NET_WM_STATE */
.
xclient
.
type
=
ClientMessage
,
e
.
xclient
.
display
=
nxagentDisplay
;
.
xclient
.
message_type
=
nxagentAtoms
[
13
],
/* _NET_WM_STATE */
e
.
xclient
.
window
=
nxagentDefaultWindows
[
pScreen
->
myNum
];
.
xclient
.
display
=
nxagentDisplay
,
e
.
xclient
.
format
=
32
;
.
xclient
.
window
=
nxagentDefaultWindows
[
pScreen
->
myNum
],
e
.
xclient
.
data
.
l
[
0
]
=
nxagentOption
(
Fullscreen
)
?
1
:
0
;
.
xclient
.
format
=
32
,
e
.
xclient
.
data
.
l
[
1
]
=
nxagentAtoms
[
14
];
/* _NET_WM_STATE_FULLSCREEN */
.
xclient
.
data
.
l
[
0
]
=
nxagentOption
(
Fullscreen
)
?
1
:
0
,
.
xclient
.
data
.
l
[
1
]
=
nxagentAtoms
[
14
]
/* _NET_WM_STATE_FULLSCREEN */
};
XSendEvent
(
nxagentDisplay
,
DefaultRootWindow
(
nxagentDisplay
),
False
,
XSendEvent
(
nxagentDisplay
,
DefaultRootWindow
(
nxagentDisplay
),
False
,
SubstructureRedirectMask
,
&
e
);
SubstructureRedirectMask
,
&
e
);
...
@@ -1170,11 +1166,7 @@ void nxagentMoveViewport(ScreenPtr pScreen, int hShift, int vShift)
...
@@ -1170,11 +1166,7 @@ void nxagentMoveViewport(ScreenPtr pScreen, int hShift, int vShift)
* pan and one for vertical pan.
* pan and one for vertical pan.
*/
*/
BoxRec
hRect
;
BoxRec
hRect
=
{.
x1
=
-
newX
,
.
y1
=
-
newY
};
BoxRec
vRect
;
hRect
.
x1
=
-
newX
;
hRect
.
y1
=
-
newY
;
if
(
hShift
<
0
)
if
(
hShift
<
0
)
{
{
...
@@ -1192,8 +1184,7 @@ void nxagentMoveViewport(ScreenPtr pScreen, int hShift, int vShift)
...
@@ -1192,8 +1184,7 @@ void nxagentMoveViewport(ScreenPtr pScreen, int hShift, int vShift)
fprintf
(
stderr
,
"nxagentMoveViewport: hRect p1[%i, %i] - p2[%i, %i].
\n
"
,
hRect
.
x1
,
hRect
.
y1
,
hRect
.
x2
,
hRect
.
y2
);
fprintf
(
stderr
,
"nxagentMoveViewport: hRect p1[%i, %i] - p2[%i, %i].
\n
"
,
hRect
.
x1
,
hRect
.
y1
,
hRect
.
x2
,
hRect
.
y2
);
#endif
#endif
vRect
.
x1
=
-
newX
;
BoxRec
vRect
=
{.
x1
=
-
newX
,
.
y1
=
-
newY
};
vRect
.
y1
=
-
newY
;
if
(
vShift
<
0
)
if
(
vShift
<
0
)
{
{
...
@@ -2263,7 +2254,6 @@ void nxagentShapeWindow(WindowPtr pWin)
...
@@ -2263,7 +2254,6 @@ void nxagentShapeWindow(WindowPtr pWin)
{
{
Region
reg
;
Region
reg
;
BoxPtr
pBox
;
BoxPtr
pBox
;
XRectangle
rect
;
if
(
NXDisplayError
(
nxagentDisplay
)
==
1
)
if
(
NXDisplayError
(
nxagentDisplay
)
==
1
)
{
{
...
@@ -2308,10 +2298,12 @@ void nxagentShapeWindow(WindowPtr pWin)
...
@@ -2308,10 +2298,12 @@ void nxagentShapeWindow(WindowPtr pWin)
i
<
RegionNumRects
(
nxagentWindowPriv
(
pWin
)
->
boundingShape
);
i
<
RegionNumRects
(
nxagentWindowPriv
(
pWin
)
->
boundingShape
);
i
++
)
i
++
)
{
{
rect
.
x
=
pBox
[
i
].
x1
;
XRectangle
rect
=
{
rect
.
y
=
pBox
[
i
].
y1
;
.
x
=
pBox
[
i
].
x1
,
rect
.
width
=
pBox
[
i
].
x2
-
pBox
[
i
].
x1
;
.
y
=
pBox
[
i
].
y1
,
rect
.
height
=
pBox
[
i
].
y2
-
pBox
[
i
].
y1
;
.
width
=
pBox
[
i
].
x2
-
pBox
[
i
].
x1
,
.
height
=
pBox
[
i
].
y2
-
pBox
[
i
].
y1
};
XUnionRectWithRegion
(
&
rect
,
reg
,
reg
);
XUnionRectWithRegion
(
&
rect
,
reg
,
reg
);
}
}
...
@@ -2365,10 +2357,12 @@ void nxagentShapeWindow(WindowPtr pWin)
...
@@ -2365,10 +2357,12 @@ void nxagentShapeWindow(WindowPtr pWin)
i
<
RegionNumRects
(
nxagentWindowPriv
(
pWin
)
->
clipShape
);
i
<
RegionNumRects
(
nxagentWindowPriv
(
pWin
)
->
clipShape
);
i
++
)
i
++
)
{
{
rect
.
x
=
pBox
[
i
].
x1
;
XRectangle
rect
=
{
rect
.
y
=
pBox
[
i
].
y1
;
.
x
=
pBox
[
i
].
x1
,
rect
.
width
=
pBox
[
i
].
x2
-
pBox
[
i
].
x1
;
.
y
=
pBox
[
i
].
y1
,
rect
.
height
=
pBox
[
i
].
y2
-
pBox
[
i
].
y1
;
.
width
=
pBox
[
i
].
x2
-
pBox
[
i
].
x1
,
.
height
=
pBox
[
i
].
y2
-
pBox
[
i
].
y1
};
XUnionRectWithRegion
(
&
rect
,
reg
,
reg
);
XUnionRectWithRegion
(
&
rect
,
reg
,
reg
);
}
}
...
@@ -2400,14 +2394,13 @@ static int nxagentForceExposure(WindowPtr pWin, void * ptr)
...
@@ -2400,14 +2394,13 @@ static int nxagentForceExposure(WindowPtr pWin, void * ptr)
{
{
if
(
pWin
->
drawable
.
class
!=
InputOnly
)
if
(
pWin
->
drawable
.
class
!=
InputOnly
)
{
{
BoxRec
Box
;
WindowPtr
pRoot
=
pWin
->
drawable
.
pScreen
->
root
;
WindowPtr
pRoot
=
pWin
->
drawable
.
pScreen
->
root
;
BoxRec
Box
=
{
Box
.
x1
=
pWin
->
drawable
.
x
;
.
x1
=
pWin
->
drawable
.
x
,
Box
.
y1
=
pWin
->
drawable
.
y
;
.
y1
=
pWin
->
drawable
.
y
,
Box
.
x2
=
Box
.
x1
+
pWin
->
drawable
.
width
;
.
x2
=
Box
.
x1
+
pWin
->
drawable
.
width
,
Box
.
y2
=
Box
.
y1
+
pWin
->
drawable
.
height
;
.
y2
=
Box
.
y1
+
pWin
->
drawable
.
height
,
};
RegionPtr
exposedRgn
=
RegionCreate
(
&
Box
,
1
);
RegionPtr
exposedRgn
=
RegionCreate
(
&
Box
,
1
);
RegionIntersect
(
exposedRgn
,
exposedRgn
,
&
pRoot
->
winSize
);
RegionIntersect
(
exposedRgn
,
exposedRgn
,
&
pRoot
->
winSize
);
...
...
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