aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewertexteditor.cpp
diff options
context:
space:
mode:
authorArmin Weatherwax2009-06-08 11:10:27 +0200
committerMcCabe Maxsted2009-09-04 11:34:24 -0700
commit3f0082a9dda60432b8b759e09f19b495d9d5275c (patch)
tree989f5e10f9b9891ec7718b5ee2406582b6c0e352 /linden/indra/newview/llviewertexteditor.cpp
parentRebranded startup loading page to Imprudence (diff)
downloadmeta-impy-3f0082a9dda60432b8b759e09f19b495d9d5275c.zip
meta-impy-3f0082a9dda60432b8b759e09f19b495d9d5275c.tar.gz
meta-impy-3f0082a9dda60432b8b759e09f19b495d9d5275c.tar.bz2
meta-impy-3f0082a9dda60432b8b759e09f19b495d9d5275c.tar.xz
Linux middle mouse button paste/primary selection support and gtk clipboard handler (fixes crashbug using synergy mouse-keyboard-clipboard-sharing over lan)
modified: linden/doc/contributions.txt modified: linden/indra/llui/llclipboard.cpp modified: linden/indra/llui/llclipboard.h modified: linden/indra/llui/llfloater.cpp modified: linden/indra/llui/llfloater.h modified: linden/indra/llui/lllineeditor.cpp modified: linden/indra/llui/lllineeditor.h modified: linden/indra/llui/lltexteditor.cpp modified: linden/indra/llui/lltexteditor.h modified: linden/indra/llui/llview.cpp modified: linden/indra/llui/llview.h modified: linden/indra/llwindow/CMakeLists.txt new file: linden/indra/llwindow/llmousehandler.cpp modified: linden/indra/llwindow/llmousehandler.h modified: linden/indra/llwindow/llwindow.cpp modified: linden/indra/llwindow/llwindow.h modified: linden/indra/llwindow/llwindowsdl.cpp modified: linden/indra/llwindow/llwindowsdl.h modified: linden/indra/newview/lltool.cpp modified: linden/indra/newview/lltool.h modified: linden/indra/newview/llviewertexteditor.cpp modified: linden/indra/newview/llviewertexteditor.h modified: linden/indra/newview/llviewerwindow.cpp modified: linden/indra/newview/llviewerwindow.h (cherry picked from commit 594f4830922f4294dda432fa748935adffaeed8f)
Diffstat (limited to 'linden/indra/newview/llviewertexteditor.cpp')
-rw-r--r--linden/indra/newview/llviewertexteditor.cpp79
1 files changed, 32 insertions, 47 deletions
diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp
index 3e2cc19..54b7743 100644
--- a/linden/indra/newview/llviewertexteditor.cpp
+++ b/linden/indra/newview/llviewertexteditor.cpp
@@ -893,51 +893,9 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask)
893 893
894BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) 894BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
895{ 895{
896 BOOL handled = FALSE; 896 BOOL handled = FALSE;
897
898 // let scrollbar have first dibs
899 handled = LLView::childrenHandleMouseUp(x, y, mask) != NULL;
900
901 // Used to enable I Agree checkbox if the user scrolled through entire text
902 BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax());
903 if (mOnScrollEndCallback && was_scrolled_to_bottom)
904 {
905 mOnScrollEndCallback(mOnScrollEndData);
906 }
907
908 if( !handled && mTakesNonScrollClicks)
909 {
910 if( mIsSelecting )
911 {
912 // Finish selection
913 if( y > getTextRect().mTop )
914 {
915 mScrollbar->setDocPos( mScrollbar->getDocPos() - 1 );
916 }
917 else
918 if( y < getTextRect().mBottom )
919 {
920 mScrollbar->setDocPos( mScrollbar->getDocPos() + 1 );
921 }
922
923 setCursorAtLocalPos( x, y, TRUE );
924 endSelection();
925
926 updateScrollFromCursor();
927 }
928
929 if( !hasSelection() )
930 {
931 handleMouseUpOverSegment( x, y, mask );
932 }
933
934 handled = TRUE;
935 }
936
937 // Delay cursor flashing
938 resetKeystrokeTimer();
939 897
940 if( hasMouseCapture() ) 898 if( hasMouseCapture() )
941 { 899 {
942 if (mDragItem) 900 if (mDragItem)
943 { 901 {
@@ -956,8 +914,15 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
956 } 914 }
957 } 915 }
958 mDragItem = NULL; 916 mDragItem = NULL;
959 gFocusMgr.setMouseCapture( NULL ); 917 }
960 handled = TRUE; 918
919 handled = LLTextEditor::handleMouseUp(x,y,mask);
920
921 // Used to enable I Agree checkbox if the user scrolled through entire text
922 BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax());
923 if (mOnScrollEndCallback && was_scrolled_to_bottom)
924 {
925 mOnScrollEndCallback(mOnScrollEndData);
961 } 926 }
962 927
963 return handled; 928 return handled;
@@ -999,6 +964,24 @@ BOOL LLViewerTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask)
999 return handled; 964 return handled;
1000} 965}
1001 966
967BOOL LLViewerTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
968{
969 BOOL handled = FALSE;
970 handled = childrenHandleMiddleMouseDown(x, y, mask) != NULL;
971 if (!handled)
972 {
973 handled = LLTextEditor::handleMiddleMouseDown(x, y, mask);
974 }
975 return handled;
976}
977
978BOOL LLViewerTextEditor::handleMiddleMouseUp(S32 x, S32 y, MASK mask)
979{
980 BOOL handled = childrenHandleMiddleMouseUp(x, y, mask) != NULL;
981
982 return handled;
983}
984
1002BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) 985BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
1003{ 986{
1004 BOOL handled = FALSE; 987 BOOL handled = FALSE;
@@ -1021,7 +1004,6 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
1021 } 1004 }
1022 } 1005 }
1023 } 1006 }
1024
1025 1007
1026 setCursorAtLocalPos( x, y, FALSE ); 1008 setCursorAtLocalPos( x, y, FALSE );
1027 deselect(); 1009 deselect();
@@ -1059,6 +1041,9 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
1059 // delay cursor flashing 1041 // delay cursor flashing
1060 resetKeystrokeTimer(); 1042 resetKeystrokeTimer();
1061 1043
1044 // take selection to 'primary' clipboard
1045 updatePrimary();
1046
1062 handled = TRUE; 1047 handled = TRUE;
1063 } 1048 }
1064 return handled; 1049 return handled;