summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorStinson Linden <stinson@lindenlab.com>2014-05-19 22:19:55 +0100
committerStinson Linden <stinson@lindenlab.com>2014-05-19 22:19:55 +0100
commitbabd89b77050ab49166f2fbd6d460884070140d9 (patch)
treedd3039e009f3e0f7ca2de578f4599e79ca15a1dc /indra/llwindow
parent08e83a341e76de8fa4d8c4a974edbe3e0bd1c128 (diff)
parent644ca6a0f8a7759119814f88df93b8e838321a12 (diff)
Pull and merge from ssh://hg@bitbucket.org/lindenlab/viewer-release.
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llopenglview-objc.h3
-rw-r--r--indra/llwindow/llopenglview-objc.mm21
-rwxr-xr-xindra/llwindow/llwindow.h2
-rwxr-xr-xindra/llwindow/llwindowmacosx-objc.h1
-rwxr-xr-xindra/llwindow/llwindowmacosx-objc.mm7
-rwxr-xr-xindra/llwindow/llwindowmacosx.h5
6 files changed, 32 insertions, 7 deletions
diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h
index 1e0e47cd02..f1fab3b2c6 100644
--- a/indra/llwindow/llopenglview-objc.h
+++ b/indra/llwindow/llopenglview-objc.h
@@ -42,6 +42,7 @@
unsigned int mMarkedTextLength;
bool mMarkedTextAllowed;
bool mSimulatedRightClick;
+ bool mOldResize;
}
- (id) initWithSamples:(NSUInteger)samples;
- (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync;
@@ -49,6 +50,8 @@
- (void)commitCurrentPreedit;
+- (void) setOldResize:(bool)oldresize;
+
// rebuildContext
// Destroys and recreates a context with the view's internal format set via setPixelFormat;
// Use this in event of needing to rebuild a context for whatever reason, without needing to assign a new pixel format.
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm
index b393a3796d..017ea3769c 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -94,8 +94,11 @@ attributedStringInfo getSegments(NSAttributedString *str)
// Force a high quality update after live resizing
- (void) viewDidEndLiveResize
{
- NSSize size = [self frame].size;
- callResize(size.width, size.height);
+ if (mOldResize) //Maint-3135
+ {
+ NSSize size = [self frame].size;
+ callResize(size.width, size.height);
+ }
}
- (unsigned long)getVramSize
@@ -124,10 +127,18 @@ attributedStringInfo getSegments(NSAttributedString *str)
object:[self window]];
}
+- (void)setOldResize:(bool)oldresize
+{
+ mOldResize = oldresize;
+}
+
- (void)windowResized:(NSNotification *)notification;
{
- //NSSize size = [self frame].size;
- //callResize(size.width, size.height);
+ if (!mOldResize) //Maint-3288
+ {
+ NSSize size = [self frame].size;
+ callResize(size.width, size.height);
+ }
}
- (void)dealloc
@@ -204,6 +215,8 @@ attributedStringInfo getSegments(NSAttributedString *str)
[glContext setValues:(const GLint*)0 forParameter:NSOpenGLCPSwapInterval];
}
+ mOldResize = false;
+
return self;
}
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index ee1b0bbffb..0a30f4c807 100755
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -124,7 +124,7 @@ public:
virtual void swapBuffers() = 0;
virtual void bringToFront() = 0;
virtual void focusClient() { }; // this may not have meaning or be required on other platforms, therefore, it's not abstract
-
+ virtual void setOldResize(bool oldresize) { };
// handy coordinate space conversion routines
// NB: screen to window and vice verse won't work on width/height coordinate pairs,
// as the conversion must take into account left AND right border widths, etc.
diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h
index 81b25601a9..d64525fbdd 100755
--- a/indra/llwindow/llwindowmacosx-objc.h
+++ b/indra/llwindow/llwindowmacosx-objc.h
@@ -74,6 +74,7 @@ void showNSCursor();
void hideNSCursorTillMove(bool hide);
void requestUserAttention();
long showAlert(std::string title, std::string text, int type);
+void setResizeMode(bool oldresize, void* glview);
NSWindowRef createNSWindow(int x, int y, int width, int height);
diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm
index 0768d0352e..1a21bf8430 100755
--- a/indra/llwindow/llwindowmacosx-objc.mm
+++ b/indra/llwindow/llwindowmacosx-objc.mm
@@ -91,7 +91,7 @@ const unsigned short *copyFromPBoard()
NSArray *objToPaste = [pboard readObjectsForClasses:classArray options:[NSDictionary dictionary]];
str = [objToPaste objectAtIndex:0];
}
- unichar* temp = (unichar*)calloc([str length], sizeof(unichar));
+ unichar* temp = (unichar*)calloc([str length]+1, sizeof(unichar));
[str getCharacters:temp];
[pool release];
return temp;
@@ -222,6 +222,11 @@ GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync)
return glview;
}
+void setResizeMode(bool oldresize, void* glview)
+{
+ [(LLOpenGLView *)glview setOldResize:oldresize];
+}
+
void glSwapBuffers(void* context)
{
[(NSOpenGLContext*)context flushBuffer];
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index 6a6b39e674..825fd05c5f 100755
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -152,7 +152,10 @@ protected:
BOOL resetDisplayResolution();
BOOL shouldPostQuit() { return mPostQuit; }
-
+
+ //Satisfy MAINT-3135 and MAINT-3288 with a flag.
+ /*virtual */ void setOldResize(bool oldresize) {setResizeMode(oldresize, mGLView); }
+
protected:
//