Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
f318d936
Commit
f318d936
authored
15 years ago
by
Igor Borovkov
Browse files
Options
Downloads
Plain Diff
merge
--HG-- branch : product-engine
parents
beaeb85d
51b69a33
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llwindow/llwindowsdl.cpp
+2
-159
2 additions, 159 deletions
indra/llwindow/llwindowsdl.cpp
with
2 additions
and
159 deletions
indra/llwindow/llwindowsdl.cpp
+
2
−
159
View file @
f318d936
...
...
@@ -950,68 +950,7 @@ BOOL LLWindowSDL::getMaximized()
if
(
mWindow
)
{
#if LL_X11
if
(
mSDL_Display
)
{
maybe_lock_display
();
// Return data in the specified format, XA_ATOM.
U8
*
prop
;
// Actual format of the property.
int
format
;
// Actual number of items stored in the prop return data.
unsigned
long
nitems
;
// Number of bytes remaining to be read in the property if a partial read was performed.
unsigned
long
bytes_after
;
// Atom identifier that defines the actual type of the property.
Atom
type
;
// Atom used to obtain list of hints describing the window state.
Atom
wm_state
=
XInternAtom
(
mSDL_Display
,
"_NET_WM_STATE"
,
False
);
// Atoms indicates that the window is vertically/horizontally maximized.
Atom
max_vert
=
XInternAtom
(
mSDL_Display
,
"_NET_WM_STATE_MAXIMIZED_VERT"
,
False
);
Atom
max_horz
=
XInternAtom
(
mSDL_Display
,
"_NET_WM_STATE_MAXIMIZED_HORZ"
,
False
);
// How many atoms in which we interested are present in list of hints.
U32
pass
=
0
;
do
{
nitems
=
0
;
bytes_after
=
0
;
type
=
None
;
if
(
(
XGetWindowProperty
(
mSDL_Display
,
mSDL_XWindowID
,
wm_state
,
0
,
UINT_MAX
,
False
,
XA_ATOM
,
&
type
,
&
format
,
&
nitems
,
&
bytes_after
,
&
prop
)
==
Success
)
&&
type
!=
None
)
{
Atom
*
atoms
=
(
Atom
*
)
prop
;
for
(
unsigned
long
i
=
0
;
i
<
nitems
;
++
i
)
{
if
(
atoms
[
i
]
==
max_horz
)
++
pass
;
else
if
(
atoms
[
i
]
==
max_vert
)
++
pass
;
}
XFree
(
atoms
);
}
else
{
break
;
}
}
while
(
bytes_after
>
0
);
result
=
(
pass
==
2
);
maybe_unlock_display
();
}
#endif // LL_X11
// TODO
}
return
(
result
);
...
...
@@ -1019,103 +958,7 @@ BOOL LLWindowSDL::getMaximized()
BOOL
LLWindowSDL
::
maximize
()
{
#if LL_X11
if
(
mSDL_Display
&&
!
mFullscreen
)
{
maybe_lock_display
();
BOOL
is_maximize_allowed
=
FALSE
;
// Check if maximize is allowed
{
// Return data in the specified format, XA_ATOM.
U8
*
prop
;
// Actual format of the property.
int
format
;
// Actual number of items stored in the prop return data.
unsigned
long
nitems
;
// Number of bytes remaining to be read in the property if a partial read was performed.
unsigned
long
bytes_after
;
// Atom identifier that defines the actual type of the property.
Atom
type
;
// Atom used to obtain a list of atoms indicating user operations that the Window Manager supports for this window.
Atom
allowed_act
=
XInternAtom
(
mSDL_Display
,
"_NET_WM_ALLOWED_ACTIONS"
,
False
);
// Atoms that indicates that the window may be vertically/horizontally maximized.
Atom
max_vert_act
=
XInternAtom
(
mSDL_Display
,
"_NET_WM_ACTION_MAXIMIZE_HORZ"
,
False
);
Atom
max_horz_act
=
XInternAtom
(
mSDL_Display
,
"_NET_WM_ACTION_MAXIMIZE_VERT"
,
False
);
// How many atoms in which we interested are present in list of hints.
U32
pass
=
0
;
do
{
nitems
=
0
;
bytes_after
=
0
;
type
=
None
;
if
(
(
XGetWindowProperty
(
mSDL_Display
,
mSDL_XWindowID
,
allowed_act
,
0
,
UINT_MAX
,
False
,
XA_ATOM
,
&
type
,
&
format
,
&
nitems
,
&
bytes_after
,
&
prop
)
==
Success
)
&&
type
!=
None
)
{
Atom
*
atoms
=
(
Atom
*
)
prop
;
for
(
unsigned
long
i
=
0
;
i
<
nitems
;
++
i
)
{
if
(
atoms
[
i
]
==
max_vert_act
)
++
pass
;
else
if
(
atoms
[
i
]
==
max_horz_act
)
++
pass
;
}
XFree
(
atoms
);
}
else
{
break
;
}
}
while
(
bytes_after
>
0
);
is_maximize_allowed
=
(
pass
==
2
);
}
// Send maximize event to X11 system
if
(
is_maximize_allowed
)
{
XEvent
xev
;
// Atom describing the window state.
Atom
wm_state
=
XInternAtom
(
mSDL_Display
,
"_NET_WM_STATE"
,
False
);
// Atoms indicates that the window is vertically/horizontally maximized.
Atom
max_vert
=
XInternAtom
(
mSDL_Display
,
"_NET_WM_STATE_MAXIMIZED_VERT"
,
False
);
Atom
max_horz
=
XInternAtom
(
mSDL_Display
,
"_NET_WM_STATE_MAXIMIZED_HORZ"
,
False
);
memset
(
&
xev
,
0
,
sizeof
(
xev
));
xev
.
type
=
ClientMessage
;
xev
.
xclient
.
window
=
mSDL_XWindowID
;
xev
.
xclient
.
message_type
=
wm_state
;
xev
.
xclient
.
format
=
32
;
xev
.
xclient
.
data
.
l
[
0
]
=
1
;
// add/set property
xev
.
xclient
.
data
.
l
[
1
]
=
max_vert
;
xev
.
xclient
.
data
.
l
[
2
]
=
max_horz
;
xev
.
xclient
.
data
.
l
[
3
]
=
0
;
xev
.
xclient
.
data
.
l
[
4
]
=
0
;
XSendEvent
(
mSDL_Display
,
DefaultRootWindow
(
mSDL_Display
),
False
,
SubstructureNotifyMask
,
&
xev
);
}
maybe_unlock_display
();
return
is_maximize_allowed
;
}
#endif // LL_X11
// TODO
return
FALSE
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment