------------------------------------------------------------------------------
| 594 | |
| 595 | //------------------------------------------------------------------------------ |
| 596 | void vtkXRenderWindowInteractor::DispatchEvent(XEvent* event) |
| 597 | { |
| 598 | int xp, yp; |
| 599 | |
| 600 | switch (event->type) |
| 601 | { |
| 602 | case Expose: |
| 603 | { |
| 604 | if (!this->Enabled) |
| 605 | { |
| 606 | return; |
| 607 | } |
| 608 | XEvent result; |
| 609 | while (vtkXCheckTypedWindowEvent(this->DisplayId, this->WindowId, Expose, &result)) |
| 610 | { |
| 611 | // just getting the expose configure event |
| 612 | event = &result; |
| 613 | } |
| 614 | XExposeEvent* exposeEvent = reinterpret_cast<XExposeEvent*>(event); |
| 615 | this->SetEventSize(exposeEvent->width, exposeEvent->height); |
| 616 | xp = exposeEvent->x; |
| 617 | yp = exposeEvent->y; |
| 618 | yp = this->Size[1] - yp - 1; |
| 619 | this->SetEventPosition(xp, yp); |
| 620 | |
| 621 | // only render if we are currently accepting events |
| 622 | if (this->Enabled) |
| 623 | { |
| 624 | this->InvokeEvent(vtkCommand::ExposeEvent, nullptr); |
| 625 | this->Render(); |
| 626 | } |
| 627 | } |
| 628 | break; |
| 629 | |
| 630 | case MapNotify: |
| 631 | { |
| 632 | // only render if we are currently accepting events |
| 633 | if (this->Enabled && this->GetRenderWindow()->GetNeverRendered()) |
| 634 | { |
| 635 | this->Render(); |
| 636 | } |
| 637 | } |
| 638 | break; |
| 639 | |
| 640 | case ConfigureNotify: |
| 641 | { |
| 642 | XEvent result; |
| 643 | while (vtkXCheckTypedWindowEvent(this->DisplayId, this->WindowId, ConfigureNotify, &result)) |
| 644 | { |
| 645 | // just getting the last configure event |
| 646 | event = &result; |
| 647 | } |
| 648 | XConfigureEvent* configureEvent = reinterpret_cast<XConfigureEvent*>(event); |
| 649 | int width = configureEvent->width; |
| 650 | int height = configureEvent->height; |
| 651 | if (width != this->Size[0] || height != this->Size[1]) |
| 652 | { |
| 653 | bool resizeSmaller = width <= this->Size[0] && height <= this->Size[1]; |
no test coverage detected