diff options
Diffstat (limited to 'linden/indra/newview/llviewerwindow.cpp')
-rw-r--r-- | linden/indra/newview/llviewerwindow.cpp | 489 |
1 files changed, 122 insertions, 367 deletions
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index 1554075..99bbb2a 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp | |||
@@ -547,19 +547,42 @@ bool LLViewerWindow::shouldShowToolTipFor(LLMouseHandler *mh) | |||
547 | return false; | 547 | return false; |
548 | } | 548 | } |
549 | 549 | ||
550 | BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask) | 550 | BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down) |
551 | { | 551 | { |
552 | std::string buttonname; | ||
553 | std::string buttonstatestr; | ||
554 | BOOL handled = FALSE; | ||
552 | S32 x = pos.mX; | 555 | S32 x = pos.mX; |
553 | S32 y = pos.mY; | 556 | S32 y = pos.mY; |
554 | x = llround((F32)x / mDisplayScale.mV[VX]); | 557 | x = llround((F32)x / mDisplayScale.mV[VX]); |
555 | y = llround((F32)y / mDisplayScale.mV[VY]); | 558 | y = llround((F32)y / mDisplayScale.mV[VY]); |
556 | 559 | ||
557 | LLView::sMouseHandlerMessage.clear(); | 560 | if (down) |
558 | 561 | buttonstatestr = "down" ; | |
559 | if (gDebugClicks) | 562 | else |
563 | buttonstatestr = "up" ; | ||
564 | |||
565 | switch (clicktype) | ||
560 | { | 566 | { |
561 | llinfos << "ViewerWindow left mouse down at " << x << "," << y << llendl; | 567 | case LLMouseHandler::CLICK_LEFT: |
568 | mLeftMouseDown = down; | ||
569 | buttonname = "Left"; | ||
570 | break; | ||
571 | case LLMouseHandler::CLICK_RIGHT: | ||
572 | mRightMouseDown = down; | ||
573 | buttonname = "Right"; | ||
574 | break; | ||
575 | case LLMouseHandler::CLICK_MIDDLE: | ||
576 | mMiddleMouseDown = down; | ||
577 | buttonname = "Middle"; | ||
578 | break; | ||
579 | case LLMouseHandler::CLICK_DOUBLELEFT: | ||
580 | mLeftMouseDown = down; | ||
581 | buttonname = "Left Double Click"; | ||
582 | break; | ||
562 | } | 583 | } |
584 | |||
585 | LLView::sMouseHandlerMessage.clear(); | ||
563 | 586 | ||
564 | if (gMenuBarView) | 587 | if (gMenuBarView) |
565 | { | 588 | { |
@@ -567,7 +590,10 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask | |||
567 | gMenuBarView->resetMenuTrigger(); | 590 | gMenuBarView->resetMenuTrigger(); |
568 | } | 591 | } |
569 | 592 | ||
570 | mLeftMouseDown = TRUE; | 593 | if (gDebugClicks) |
594 | { | ||
595 | llinfos << "ViewerWindow " << buttonname << " mouse " << buttonstatestr << " at " << x << "," << y << llendl; | ||
596 | } | ||
571 | 597 | ||
572 | // Make sure we get a coresponding mouseup event, even if the mouse leaves the window | 598 | // Make sure we get a coresponding mouseup event, even if the mouse leaves the window |
573 | mWindow->captureMouse(); | 599 | mWindow->captureMouse(); |
@@ -576,9 +602,9 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask | |||
576 | gMouseIdleTimer.reset(); | 602 | gMouseIdleTimer.reset(); |
577 | 603 | ||
578 | // Hide tooltips on mousedown | 604 | // Hide tooltips on mousedown |
579 | mToolTipBlocked = TRUE; | 605 | mToolTipBlocked = down; |
580 | 606 | ||
581 | // Also hide hover info on mousedown | 607 | // Also hide hover info on mousedown/mouseup |
582 | if (gHoverView) | 608 | if (gHoverView) |
583 | { | 609 | { |
584 | gHoverView->cancelHover(); | 610 | gHoverView->cancelHover(); |
@@ -587,7 +613,7 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask | |||
587 | // Don't let the user move the mouse out of the window until mouse up. | 613 | // Don't let the user move the mouse out of the window until mouse up. |
588 | if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() ) | 614 | if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() ) |
589 | { | 615 | { |
590 | mWindow->setMouseClipping(TRUE); | 616 | mWindow->setMouseClipping(down); |
591 | } | 617 | } |
592 | 618 | ||
593 | LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); | 619 | LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); |
@@ -598,10 +624,9 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask | |||
598 | mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); | 624 | mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); |
599 | if (LLView::sDebugMouseHandling) | 625 | if (LLView::sDebugMouseHandling) |
600 | { | 626 | { |
601 | llinfos << "Left Mouse Down handled by captor " << mouse_captor->getName() << llendl; | 627 | llinfos << buttonname << " Mouse " << buttonstatestr << " handled by captor " << mouse_captor->getName() << llendl; |
602 | } | 628 | } |
603 | 629 | return mouse_captor->handleAnyMouseClick(local_x, local_y, mask, clicktype, down); | |
604 | return mouse_captor->handleMouseDown(local_x, local_y, mask); | ||
605 | } | 630 | } |
606 | 631 | ||
607 | // Topmost view gets a chance before the hierarchy | 632 | // Topmost view gets a chance before the hierarchy |
@@ -610,215 +635,95 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask | |||
610 | { | 635 | { |
611 | S32 local_x, local_y; | 636 | S32 local_x, local_y; |
612 | top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); | 637 | top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); |
613 | if (top_ctrl->pointInView(local_x, local_y)) | 638 | if (down) |
614 | { | 639 | { |
615 | return top_ctrl->handleMouseDown(local_x, local_y, mask); | 640 | if (top_ctrl->pointInView(local_x, local_y)) |
616 | } | 641 | { |
617 | else | 642 | return top_ctrl->handleAnyMouseClick(local_x, local_y, mask, clicktype, down) ; |
618 | { | 643 | } |
619 | gFocusMgr.setTopCtrl(NULL); | 644 | else |
645 | { | ||
646 | gFocusMgr.setTopCtrl(NULL); | ||
647 | } | ||
620 | } | 648 | } |
621 | } | 649 | else |
650 | handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask); | ||
622 | 651 | ||
652 | |||
653 | } | ||
623 | // Give the UI views a chance to process the click | 654 | // Give the UI views a chance to process the click |
624 | if( mRootView->handleMouseDown(x, y, mask) ) | 655 | if( mRootView->handleAnyMouseClick(x, y, mask, clicktype, down) ) |
625 | { | 656 | { |
626 | if (LLView::sDebugMouseHandling) | 657 | if (LLView::sDebugMouseHandling) |
627 | { | 658 | { |
628 | llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl; | 659 | llinfos << buttonname << " Mouse " << buttonstatestr << " " << LLView::sMouseHandlerMessage << llendl; |
629 | } | 660 | } |
630 | return TRUE; | 661 | return TRUE; |
631 | } | 662 | } |
632 | else if (LLView::sDebugMouseHandling) | 663 | else if (LLView::sDebugMouseHandling) |
633 | { | 664 | { |
634 | llinfos << "Left Mouse Down not handled by view" << llendl; | 665 | llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl; |
635 | } | ||
636 | |||
637 | if (gDisconnected) | ||
638 | { | ||
639 | return FALSE; | ||
640 | } | ||
641 | |||
642 | if(LLToolMgr::getInstance()->getCurrentTool()->handleMouseDown( x, y, mask ) ) | ||
643 | { | ||
644 | // This is necessary to force clicks in the world to cause edit | ||
645 | // boxes that might have keyboard focus to relinquish it, and hence | ||
646 | // cause a commit to update their value. JC | ||
647 | gFocusMgr.setKeyboardFocus(NULL); | ||
648 | return TRUE; | ||
649 | } | ||
650 | |||
651 | return FALSE; | ||
652 | } | ||
653 | |||
654 | BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask) | ||
655 | { | ||
656 | S32 x = pos.mX; | ||
657 | S32 y = pos.mY; | ||
658 | x = llround((F32)x / mDisplayScale.mV[VX]); | ||
659 | y = llround((F32)y / mDisplayScale.mV[VY]); | ||
660 | |||
661 | LLView::sMouseHandlerMessage.clear(); | ||
662 | |||
663 | if (gDebugClicks) | ||
664 | { | ||
665 | llinfos << "ViewerWindow left mouse double-click at " << x << "," << y << llendl; | ||
666 | } | 666 | } |
667 | 667 | if (down) | |
668 | mLeftMouseDown = TRUE; | ||
669 | |||
670 | // Hide tooltips | ||
671 | if( mToolTip ) | ||
672 | { | 668 | { |
673 | mToolTip->setVisible( FALSE ); | 669 | if (gDisconnected) |
674 | } | ||
675 | |||
676 | LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); | ||
677 | if( mouse_captor ) | ||
678 | { | ||
679 | S32 local_x; | ||
680 | S32 local_y; | ||
681 | mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); | ||
682 | if (LLView::sDebugMouseHandling) | ||
683 | { | 670 | { |
684 | llinfos << "Left Mouse Down handled by captor " << mouse_captor->getName() << llendl; | 671 | return FALSE; |
685 | } | ||
686 | |||
687 | return mouse_captor->handleDoubleClick(local_x, local_y, mask); | ||
688 | } | ||
689 | |||
690 | // Check for hit on UI. | ||
691 | LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); | ||
692 | if (top_ctrl) | ||
693 | { | ||
694 | S32 local_x, local_y; | ||
695 | top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); | ||
696 | if (top_ctrl->pointInView(local_x, local_y)) | ||
697 | { | ||
698 | return top_ctrl->handleDoubleClick(local_x, local_y, mask); | ||
699 | } | 672 | } |
700 | else | 673 | |
674 | if(LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) ) | ||
701 | { | 675 | { |
702 | gFocusMgr.setTopCtrl(NULL); | 676 | // This is necessary to force clicks in the world to cause edit |
677 | // boxes that might have keyboard focus to relinquish it, and hence | ||
678 | // cause a commit to update their value. JC | ||
679 | gFocusMgr.setKeyboardFocus(NULL); | ||
680 | return TRUE; | ||
703 | } | 681 | } |
704 | } | 682 | } |
705 | 683 | else | |
706 | if (mRootView->handleDoubleClick(x, y, mask)) | ||
707 | { | 684 | { |
708 | if (LLView::sDebugMouseHandling) | 685 | |
686 | mWindow->releaseMouse(); | ||
687 | |||
688 | LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); | ||
689 | if( !handled ) | ||
709 | { | 690 | { |
710 | llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl; | 691 | handled = mRootView->handleAnyMouseClick(x, y, mask, clicktype, down); |
692 | } | ||
693 | |||
694 | |||
695 | |||
696 | if( !handled ) | ||
697 | { | ||
698 | if (tool) | ||
699 | { | ||
700 | handled = tool->handleAnyMouseClick(x, y, mask, clicktype, down); | ||
701 | } | ||
711 | } | 702 | } |
712 | return TRUE; | ||
713 | } | ||
714 | else if (LLView::sDebugMouseHandling) | ||
715 | { | ||
716 | llinfos << "Left Mouse Down not handled by view" << llendl; | ||
717 | } | 703 | } |
718 | 704 | ||
719 | // Why is this here? JC 9/3/2002 | 705 | return (!down); |
720 | if (gNoRender) | 706 | } |
721 | { | ||
722 | return TRUE; | ||
723 | } | ||
724 | 707 | ||
725 | if(LLToolMgr::getInstance()->getCurrentTool()->handleDoubleClick( x, y, mask ) ) | 708 | BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask) |
726 | { | 709 | { |
727 | return TRUE; | 710 | BOOL down = TRUE; |
728 | } | 711 | return handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_LEFT,down); |
712 | } | ||
729 | 713 | ||
730 | // if we got this far and nothing handled a double click, pass a normal mouse down | 714 | BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask) |
731 | return handleMouseDown(window, pos, mask); | 715 | { |
716 | // try handling as a double-click first, then a single-click if that | ||
717 | // wasn't handled. | ||
718 | BOOL down = TRUE; | ||
719 | return handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_DOUBLELEFT,down) || | ||
720 | handleMouseDown(window, pos, mask); | ||
732 | } | 721 | } |
733 | 722 | ||
734 | BOOL LLViewerWindow::handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) | 723 | BOOL LLViewerWindow::handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) |
735 | { | 724 | { |
736 | S32 x = pos.mX; | 725 | BOOL down = FALSE; |
737 | S32 y = pos.mY; | 726 | return handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_LEFT,down); |
738 | x = llround((F32)x / mDisplayScale.mV[VX]); | ||
739 | y = llround((F32)y / mDisplayScale.mV[VY]); | ||
740 | |||
741 | LLView::sMouseHandlerMessage.clear(); | ||
742 | |||
743 | if (gDebugClicks) | ||
744 | { | ||
745 | llinfos << "ViewerWindow left mouse up" << llendl; | ||
746 | } | ||
747 | |||
748 | mLeftMouseDown = FALSE; | ||
749 | |||
750 | // Indicate mouse was active | ||
751 | gMouseIdleTimer.reset(); | ||
752 | |||
753 | // Hide tooltips on mouseup | ||
754 | if( mToolTip ) | ||
755 | { | ||
756 | mToolTip->setVisible( FALSE ); | ||
757 | } | ||
758 | |||
759 | // Also hide hover info on mouseup | ||
760 | if (gHoverView) gHoverView->cancelHover(); | ||
761 | |||
762 | BOOL handled = FALSE; | ||
763 | |||
764 | mWindow->releaseMouse(); | ||
765 | |||
766 | LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); | ||
767 | |||
768 | if( tool->clipMouseWhenDown() ) | ||
769 | { | ||
770 | mWindow->setMouseClipping(FALSE); | ||
771 | } | ||
772 | |||
773 | LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); | ||
774 | if( mouse_captor ) | ||
775 | { | ||
776 | S32 local_x; | ||
777 | S32 local_y; | ||
778 | mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); | ||
779 | if (LLView::sDebugMouseHandling) | ||
780 | { | ||
781 | llinfos << "Left Mouse Up handled by captor " << mouse_captor->getName() << llendl; | ||
782 | } | ||
783 | |||
784 | return mouse_captor->handleMouseUp(local_x, local_y, mask); | ||
785 | } | ||
786 | |||
787 | LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); | ||
788 | if (top_ctrl) | ||
789 | { | ||
790 | S32 local_x, local_y; | ||
791 | top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); | ||
792 | handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask); | ||
793 | } | ||
794 | |||
795 | if( !handled ) | ||
796 | { | ||
797 | handled = mRootView->handleMouseUp(x, y, mask); | ||
798 | } | ||
799 | |||
800 | if (LLView::sDebugMouseHandling) | ||
801 | { | ||
802 | if (handled) | ||
803 | { | ||
804 | llinfos << "Left Mouse Up" << LLView::sMouseHandlerMessage << llendl; | ||
805 | } | ||
806 | else | ||
807 | { | ||
808 | llinfos << "Left Mouse Up not handled by view" << llendl; | ||
809 | } | ||
810 | } | ||
811 | |||
812 | if( !handled ) | ||
813 | { | ||
814 | if (tool) | ||
815 | { | ||
816 | handled = tool->handleMouseUp(x, y, mask); | ||
817 | } | ||
818 | } | ||
819 | |||
820 | // Always handled as far as the OS is concerned. | ||
821 | return TRUE; | ||
822 | } | 727 | } |
823 | 728 | ||
824 | 729 | ||
@@ -829,91 +734,10 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK | |||
829 | x = llround((F32)x / mDisplayScale.mV[VX]); | 734 | x = llround((F32)x / mDisplayScale.mV[VX]); |
830 | y = llround((F32)y / mDisplayScale.mV[VY]); | 735 | y = llround((F32)y / mDisplayScale.mV[VY]); |
831 | 736 | ||
832 | LLView::sMouseHandlerMessage.clear(); | 737 | BOOL down = TRUE; |
833 | 738 | BOOL handle = handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_RIGHT,down); | |
834 | if (gDebugClicks) | 739 | if (handle) |
835 | { | 740 | return handle; |
836 | llinfos << "ViewerWindow right mouse down at " << x << "," << y << llendl; | ||
837 | } | ||
838 | |||
839 | if (gMenuBarView) | ||
840 | { | ||
841 | // stop ALT-key access to menu | ||
842 | gMenuBarView->resetMenuTrigger(); | ||
843 | } | ||
844 | |||
845 | mRightMouseDown = TRUE; | ||
846 | |||
847 | // Make sure we get a coresponding mouseup event, even if the mouse leaves the window | ||
848 | mWindow->captureMouse(); | ||
849 | |||
850 | // Hide tooltips | ||
851 | if( mToolTip ) | ||
852 | { | ||
853 | mToolTip->setVisible( FALSE ); | ||
854 | } | ||
855 | |||
856 | // Also hide hover info on mousedown | ||
857 | if (gHoverView) | ||
858 | { | ||
859 | gHoverView->cancelHover(); | ||
860 | } | ||
861 | |||
862 | // Don't let the user move the mouse out of the window until mouse up. | ||
863 | if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() ) | ||
864 | { | ||
865 | mWindow->setMouseClipping(TRUE); | ||
866 | } | ||
867 | |||
868 | LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); | ||
869 | if( mouse_captor ) | ||
870 | { | ||
871 | S32 local_x; | ||
872 | S32 local_y; | ||
873 | mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); | ||
874 | if (LLView::sDebugMouseHandling) | ||
875 | { | ||
876 | llinfos << "Right Mouse Down handled by captor " << mouse_captor->getName() << llendl; | ||
877 | } | ||
878 | return mouse_captor->handleRightMouseDown(local_x, local_y, mask); | ||
879 | } | ||
880 | |||
881 | LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); | ||
882 | if (top_ctrl) | ||
883 | { | ||
884 | S32 local_x, local_y; | ||
885 | top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); | ||
886 | if (top_ctrl->pointInView(local_x, local_y)) | ||
887 | { | ||
888 | return top_ctrl->handleRightMouseDown(local_x, local_y, mask); | ||
889 | } | ||
890 | else | ||
891 | { | ||
892 | gFocusMgr.setTopCtrl(NULL); | ||
893 | } | ||
894 | } | ||
895 | |||
896 | if( mRootView->handleRightMouseDown(x, y, mask) ) | ||
897 | { | ||
898 | if (LLView::sDebugMouseHandling) | ||
899 | { | ||
900 | llinfos << "Right Mouse Down" << LLView::sMouseHandlerMessage << llendl; | ||
901 | } | ||
902 | return TRUE; | ||
903 | } | ||
904 | else if (LLView::sDebugMouseHandling) | ||
905 | { | ||
906 | llinfos << "Right Mouse Down not handled by view" << llendl; | ||
907 | } | ||
908 | |||
909 | if(LLToolMgr::getInstance()->getCurrentTool()->handleRightMouseDown( x, y, mask ) ) | ||
910 | { | ||
911 | // This is necessary to force clicks in the world to cause edit | ||
912 | // boxes that might have keyboard focus to relinquish it, and hence | ||
913 | // cause a commit to update their value. JC | ||
914 | gFocusMgr.setKeyboardFocus(NULL); | ||
915 | return TRUE; | ||
916 | } | ||
917 | 741 | ||
918 | // *HACK: this should be rolled into the composite tool logic, not | 742 | // *HACK: this should be rolled into the composite tool logic, not |
919 | // hardcoded at the top level. | 743 | // hardcoded at the top level. |
@@ -931,107 +755,27 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK | |||
931 | 755 | ||
932 | BOOL LLViewerWindow::handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) | 756 | BOOL LLViewerWindow::handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) |
933 | { | 757 | { |
934 | S32 x = pos.mX; | 758 | BOOL down = FALSE; |
935 | S32 y = pos.mY; | 759 | return handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_RIGHT,down); |
936 | x = llround((F32)x / mDisplayScale.mV[VX]); | ||
937 | y = llround((F32)y / mDisplayScale.mV[VY]); | ||
938 | |||
939 | LLView::sMouseHandlerMessage.clear(); | ||
940 | |||
941 | // Don't care about caps lock for mouse events. | ||
942 | if (gDebugClicks) | ||
943 | { | ||
944 | llinfos << "ViewerWindow right mouse up" << llendl; | ||
945 | } | ||
946 | |||
947 | mRightMouseDown = FALSE; | ||
948 | |||
949 | // Indicate mouse was active | ||
950 | gMouseIdleTimer.reset(); | ||
951 | |||
952 | // Hide tooltips on mouseup | ||
953 | if( mToolTip ) | ||
954 | { | ||
955 | mToolTip->setVisible( FALSE ); | ||
956 | } | ||
957 | |||
958 | // Also hide hover info on mouseup | ||
959 | if (gHoverView) gHoverView->cancelHover(); | ||
960 | |||
961 | BOOL handled = FALSE; | ||
962 | |||
963 | mWindow->releaseMouse(); | ||
964 | |||
965 | LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); | ||
966 | |||
967 | if( tool->clipMouseWhenDown() ) | ||
968 | { | ||
969 | mWindow->setMouseClipping(FALSE); | ||
970 | } | ||
971 | |||
972 | LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); | ||
973 | if( mouse_captor ) | ||
974 | { | ||
975 | S32 local_x; | ||
976 | S32 local_y; | ||
977 | mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); | ||
978 | if (LLView::sDebugMouseHandling) | ||
979 | { | ||
980 | llinfos << "Right Mouse Up handled by captor " << mouse_captor->getName() << llendl; | ||
981 | } | ||
982 | return mouse_captor->handleRightMouseUp(local_x, local_y, mask); | ||
983 | } | ||
984 | |||
985 | LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); | ||
986 | if (top_ctrl) | ||
987 | { | ||
988 | S32 local_x, local_y; | ||
989 | top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); | ||
990 | handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleRightMouseUp(local_x, local_y, mask); | ||
991 | } | ||
992 | |||
993 | if( !handled ) | ||
994 | { | ||
995 | handled = mRootView->handleRightMouseUp(x, y, mask); | ||
996 | } | ||
997 | |||
998 | if (LLView::sDebugMouseHandling) | ||
999 | { | ||
1000 | if (handled) | ||
1001 | { | ||
1002 | llinfos << "Right Mouse Up" << LLView::sMouseHandlerMessage << llendl; | ||
1003 | } | ||
1004 | else | ||
1005 | { | ||
1006 | llinfos << "Right Mouse Up not handled by view" << llendl; | ||
1007 | } | ||
1008 | } | ||
1009 | |||
1010 | if( !handled ) | ||
1011 | { | ||
1012 | if (tool) | ||
1013 | { | ||
1014 | handled = tool->handleRightMouseUp(x, y, mask); | ||
1015 | } | ||
1016 | } | ||
1017 | |||
1018 | // Always handled as far as the OS is concerned. | ||
1019 | return TRUE; | ||
1020 | } | 760 | } |
1021 | 761 | ||
1022 | BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask) | 762 | BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask) |
1023 | { | 763 | { |
764 | BOOL down = TRUE; | ||
1024 | gVoiceClient->middleMouseState(true); | 765 | gVoiceClient->middleMouseState(true); |
1025 | 766 | handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_MIDDLE,down); | |
1026 | // Always handled as far as the OS is concerned. | 767 | |
768 | // Always handled as far as the OS is concerned. | ||
1027 | return TRUE; | 769 | return TRUE; |
1028 | } | 770 | } |
1029 | 771 | ||
1030 | BOOL LLViewerWindow::handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) | 772 | BOOL LLViewerWindow::handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) |
1031 | { | 773 | { |
774 | BOOL down = FALSE; | ||
1032 | gVoiceClient->middleMouseState(false); | 775 | gVoiceClient->middleMouseState(false); |
1033 | 776 | handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_MIDDLE,down); | |
1034 | // Always handled as far as the OS is concerned. | 777 | |
778 | // Always handled as far as the OS is concerned. | ||
1035 | return TRUE; | 779 | return TRUE; |
1036 | } | 780 | } |
1037 | 781 | ||
@@ -1404,6 +1148,7 @@ LLViewerWindow::LLViewerWindow( | |||
1404 | mWindowRect(0, height, width, 0), | 1148 | mWindowRect(0, height, width, 0), |
1405 | mVirtualWindowRect(0, height, width, 0), | 1149 | mVirtualWindowRect(0, height, width, 0), |
1406 | mLeftMouseDown(FALSE), | 1150 | mLeftMouseDown(FALSE), |
1151 | mMiddleMouseDown(FALSE), | ||
1407 | mRightMouseDown(FALSE), | 1152 | mRightMouseDown(FALSE), |
1408 | mToolTip(NULL), | 1153 | mToolTip(NULL), |
1409 | mToolTipBlocked(FALSE), | 1154 | mToolTipBlocked(FALSE), |
@@ -3261,6 +3006,16 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, | |||
3261 | { | 3006 | { |
3262 | moveable_object_selected = TRUE; | 3007 | moveable_object_selected = TRUE; |
3263 | this_object_movable = TRUE; | 3008 | this_object_movable = TRUE; |
3009 | |||
3010 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g | ||
3011 | if ( (rlv_handler_t::isEnabled()) && | ||
3012 | ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) ) | ||
3013 | { | ||
3014 | LLVOAvatar* pAvatar = gAgent.getAvatarObject(); | ||
3015 | if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == object->getRootEdit()) ) | ||
3016 | moveable_object_selected = this_object_movable = FALSE; | ||
3017 | } | ||
3018 | // [/RLVa:KB] | ||
3264 | } | 3019 | } |
3265 | all_selected_objects_move = all_selected_objects_move && this_object_movable; | 3020 | all_selected_objects_move = all_selected_objects_move && this_object_movable; |
3266 | all_selected_objects_modify = all_selected_objects_modify && object->permModify(); | 3021 | all_selected_objects_modify = all_selected_objects_modify && object->permModify(); |