Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VTK
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Michael Migliore
VTK
Commits
3a982ec8
Commit
3a982ec8
authored
Dec 22, 2018
by
Dan Lipsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace busy waiting.
parent
c9fa0226
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
32 deletions
+22
-32
Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx
Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx
+22
-32
No files found.
Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx
View file @
3a982ec8
...
...
@@ -425,16 +425,16 @@ void vtkXOpenGLRenderWindow::SetShowWindow(bool val)
vtkDebugMacro
(
" Mapping the xwindow
\n
"
);
XMapWindow
(
this
->
DisplayId
,
this
->
WindowId
);
XSync
(
this
->
DisplayId
,
False
);
XWindowAttributes
winattr
;
XGetWindowAttributes
(
this
->
DisplayId
,
this
->
WindowId
,
&
winattr
);
// guarantee that the window is mapped before the program continues
// on to do the OpenGL rendering.
while
(
winattr
.
map_state
==
IsUnmapped
)
while
(
true
)
{
XGetWindowAttributes
(
this
->
DisplayId
,
this
->
WindowId
,
&
winattr
);
XSync
(
this
->
DisplayId
,
False
);
XEvent
e
;
XNextEvent
(
this
->
DisplayId
,
&
e
);
if
(
e
.
type
==
MapNotify
)
{
break
;
}
}
this
->
Mapped
=
1
;
}
...
...
@@ -443,16 +443,14 @@ void vtkXOpenGLRenderWindow::SetShowWindow(bool val)
vtkDebugMacro
(
" UnMapping the xwindow
\n
"
);
XUnmapWindow
(
this
->
DisplayId
,
this
->
WindowId
);
XSync
(
this
->
DisplayId
,
False
);
XWindowAttributes
winattr
;
XGetWindowAttributes
(
this
->
DisplayId
,
this
->
WindowId
,
&
winattr
);
// guarantee that the window is mapped before the program continues
// on to do the OpenGL rendering.
while
(
winattr
.
map_state
!=
IsUnmapped
)
while
(
true
)
{
XGetWindowAttributes
(
this
->
DisplayId
,
this
->
WindowId
,
&
winattr
);
XSync
(
this
->
DisplayId
,
False
);
XEvent
e
;
XNextEvent
(
this
->
DisplayId
,
&
e
);
if
(
e
.
type
==
UnmapNotify
)
{
break
;
}
}
this
->
Mapped
=
0
;
}
...
...
@@ -1004,23 +1002,15 @@ void vtkXOpenGLRenderWindow::SetSize(int width,int height)
static_cast
<
unsigned
int
>
(
width
),
static_cast
<
unsigned
int
>
(
height
));
// this is an async call so we wait until we
// know it has been resized. To avoid infinite
// loops we put in a count limit just to be safe
XWindowAttributes
attribs
;
int
count
=
20000
;
do
// know it has been resized.
while
(
true
)
{
XSync
(
this
->
DisplayId
,
False
);
// Find the current window size
XGetWindowAttributes
(
this
->
DisplayId
,
this
->
WindowId
,
&
attribs
);
count
--
;
}
while
(
count
&&
(
attribs
.
width
!=
width
||
attribs
.
height
!=
height
));
if
(
!
count
)
{
vtkWarningMacro
(
"warning window did not resize in the allotted time"
);
XEvent
e
;
XNextEvent
(
this
->
DisplayId
,
&
e
);
if
(
e
.
type
==
ConfigureNotify
)
{
break
;
}
}
}
...
...
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