x11_wait_for blocks execution in raspbian

This commit is contained in:
Jinhao 2018-08-24 22:57:05 +08:00
parent 7e21126f69
commit 74f060acbc

View File

@ -745,6 +745,14 @@ namespace nana{
{
nana::detail::platform_scope_guard psg;
Display* disp = restrict::spec.open_display();
//Returns if the requested visibility is same with the current status.
//In some X-Server versions/implementations, XMapWindow() doesn't generate
//a ConfigureNotify if the requested visibility is same with the current status.
//It causes that x11_wait_for always waiting for the ConfigureNotify.
if(show == is_window_visible(wd))
return;
if(show)
{
::XMapWindow(disp, reinterpret_cast<Window>(wd));
@ -1050,6 +1058,16 @@ namespace nana{
XSizeHints hints;
nana::detail::platform_scope_guard psg;
//Returns if the requested rectangle is same with the current rectangle.
//In some X-Server versions/implementations, XMapWindow() doesn't generate
//a ConfigureNotify if the requested rectangle is same with the current rectangle.
//It causes that x11_wait_for always waiting for the ConfigureNotify.
rectangle current_r;
get_window_rect(wd, current_r);
if(r == current_r)
return true;
::XGetWMNormalHints(disp, reinterpret_cast<Window>(wd), &hints, &supplied);
if((hints.flags & (PMinSize | PMaxSize)) && (hints.min_width == hints.max_width) && (hints.min_height == hints.max_height))
{
@ -1239,6 +1257,15 @@ namespace nana{
auto disp = restrict::spec.open_display();
nana::detail::platform_scope_guard psg;
//Returns if the requested size is same with the current size.
//In some X-Server versions/implementations, XMapWindow() doesn't generate
//a ConfigureNotify if the requested size is same with the current size.
//It causes that x11_wait_for always waiting for the ConfigureNotify.
rectangle current_r;
get_window_rect(wd, current_r);
if(current_r.dimension() == sz)
return true;
//Check the XSizeHints for testing whether the window is sizable.
XSizeHints hints;
long supplied;
@ -1274,6 +1301,9 @@ namespace nana{
unsigned border, depth;
nana::detail::platform_scope_guard psg;
::XGetGeometry(restrict::spec.open_display(), reinterpret_cast<Window>(wd), &root, &x, &y, &r.width, &r.height, &border, &depth);
auto pos = window_position(wd);
r.position(pos);
#endif
}