diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-04-15 19:31:20 +0300 | 
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-04-15 19:31:20 +0300 | 
| commit | ae931987356a71dbe8fc7ec31f2a2fe9108b4495 (patch) | |
| tree | d8edd9820ad2848f4adebc310ffe25d6ec355885 /indra/llwindow | |
| parent | 5a893f262f6c8367e7098ac68f8d605e80695745 (diff) | |
| parent | cf2b4dbfb280986cf859b12fd55158d7b9e0ac3d (diff) | |
Merge branch 'main' into marchcat/maint-c-restore
# Conflicts:
#	indra/llcommon/lldate.h
#	indra/newview/llappviewer.cpp
#	indra/newview/llinventorybridge.cpp
#	indra/newview/llmaterialeditor.cpp
#	indra/newview/llviewerparceloverlay.cpp
#	indra/newview/llvoavatar.cpp
Diffstat (limited to 'indra/llwindow')
| -rw-r--r-- | indra/llwindow/llwindowmacosx.cpp | 86 | ||||
| -rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 10 | 
2 files changed, 84 insertions, 12 deletions
| diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 6c3be3eef8..dadbc83f45 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -279,6 +279,10 @@ void callResetKeys()  bool callUnicodeCallback(wchar_t character, unsigned int mask)  { +    if (!gWindowImplementation) +    { +        return false; +    }      NativeKeyEventData eventData;      memset(&eventData, 0, sizeof(NativeKeyEventData)); @@ -300,7 +304,7 @@ bool callUnicodeCallback(wchar_t character, unsigned int mask)  void callFocus()  { -    if (gWindowImplementation) +    if (gWindowImplementation && gWindowImplementation->getCallbacks())      {          gWindowImplementation->getCallbacks()->handleFocus(gWindowImplementation);      } @@ -308,7 +312,7 @@ void callFocus()  void callFocusLost()  { -    if (gWindowImplementation) +    if (gWindowImplementation && gWindowImplementation->getCallbacks())      {          gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation);      } @@ -316,6 +320,10 @@ void callFocusLost()  void callRightMouseDown(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      if (gWindowImplementation->allowsLanguageInput())      {          gWindowImplementation->interruptLanguageTextInput(); @@ -329,6 +337,10 @@ void callRightMouseDown(float *pos, MASK mask)  void callRightMouseUp(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      if (gWindowImplementation->allowsLanguageInput())      {          gWindowImplementation->interruptLanguageTextInput(); @@ -342,6 +354,10 @@ void callRightMouseUp(float *pos, MASK mask)  void callLeftMouseDown(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      if (gWindowImplementation->allowsLanguageInput())      {          gWindowImplementation->interruptLanguageTextInput(); @@ -355,6 +371,10 @@ void callLeftMouseDown(float *pos, MASK mask)  void callLeftMouseUp(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      if (gWindowImplementation->allowsLanguageInput())      {          gWindowImplementation->interruptLanguageTextInput(); @@ -369,6 +389,10 @@ void callLeftMouseUp(float *pos, MASK mask)  void callDoubleClick(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      if (gWindowImplementation->allowsLanguageInput())      {          gWindowImplementation->interruptLanguageTextInput(); @@ -382,7 +406,7 @@ void callDoubleClick(float *pos, MASK mask)  void callResize(unsigned int width, unsigned int height)  { -    if (gWindowImplementation != NULL) +    if (gWindowImplementation && gWindowImplementation->getCallbacks())      {          gWindowImplementation->getCallbacks()->handleResize(gWindowImplementation, width, height);      } @@ -390,6 +414,10 @@ void callResize(unsigned int width, unsigned int height)  void callMouseMoved(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      LLCoordGL       outCoords;      outCoords.mX = ll_round(pos[0]);      outCoords.mY = ll_round(pos[1]); @@ -403,6 +431,10 @@ void callMouseMoved(float *pos, MASK mask)  void callMouseDragged(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      LLCoordGL       outCoords;      outCoords.mX = ll_round(pos[0]);      outCoords.mY = ll_round(pos[1]); @@ -424,6 +456,10 @@ void callScrollMoved(float deltaX, float deltaY)  void callMouseExit()  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->getCallbacks()->handleMouseLeave(gWindowImplementation);  } @@ -475,11 +511,19 @@ void callWindowDidChangeScreen()  void callDeltaUpdate(float *delta, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->updateMouseDeltas(delta);  }  void callOtherMouseDown(float *pos, MASK mask, int button)  { +    if (!gWindowImplementation) +    { +        return; +    }      LLCoordGL       outCoords;      outCoords.mX = ll_round(pos[0]);      outCoords.mY = ll_round(pos[1]); @@ -500,6 +544,10 @@ void callOtherMouseDown(float *pos, MASK mask, int button)  void callOtherMouseUp(float *pos, MASK mask, int button)  { +    if (!gWindowImplementation) +    { +        return; +    }      LLCoordGL outCoords;      outCoords.mX = ll_round(pos[0]);      outCoords.mY = ll_round(pos[1]); @@ -524,27 +572,43 @@ void callModifier(MASK mask)  void callHandleDragEntered(std::string url)  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_START_TRACKING);  }  void callHandleDragExited(std::string url)  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_STOP_TRACKING);  }  void callHandleDragUpdated(std::string url)  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_TRACK);  }  void callHandleDragDropped(std::string url)  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_DROPPED);  }  void callQuitHandler()  { -    if (gWindowImplementation) +    if (gWindowImplementation && gWindowImplementation->getCallbacks())      {          if(gWindowImplementation->getCallbacks()->handleCloseRequest(gWindowImplementation))          { @@ -555,7 +619,7 @@ void callQuitHandler()  void getPreeditSelectionRange(int *position, int *length)  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          gWindowImplementation->getPreeditor()->getSelectionRange(position, length);      } @@ -563,7 +627,7 @@ void getPreeditSelectionRange(int *position, int *length)  void getPreeditMarkedRange(int *position, int *length)  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          gWindowImplementation->getPreeditor()->getPreeditRange(position, length);      } @@ -571,7 +635,7 @@ void getPreeditMarkedRange(int *position, int *length)  void setPreeditMarkedRange(int position, int length)  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          gWindowImplementation->getPreeditor()->markAsPreedit(position, length);      } @@ -580,7 +644,7 @@ void setPreeditMarkedRange(int position, int length)  bool handleUnicodeCharacter(wchar_t c)  {      bool success = false; -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          success = gWindowImplementation->getPreeditor()->handleUnicodeCharHere(c);      } @@ -590,7 +654,7 @@ bool handleUnicodeCharacter(wchar_t c)  void resetPreedit()  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          gWindowImplementation->getPreeditor()->resetPreedit();      } @@ -600,7 +664,7 @@ void resetPreedit()  // This largely mirrors the old implementation, only sans the carbon parameters.  void setMarkedText(unsigned short *unitext, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, attributedStringInfo segments)  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          LLPreeditor *preeditor = gWindowImplementation->getPreeditor();          preeditor->resetPreedit(); @@ -623,7 +687,7 @@ void setMarkedText(unsigned short *unitext, unsigned int *selectedRange, unsigne  void getPreeditLocation(float *location, unsigned int length)  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          LLPreeditor *preeditor = gWindowImplementation->getPreeditor();          LLCoordGL coord; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 83ae302859..4a4dab712b 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -4055,7 +4055,15 @@ void LLWindowWin32::fillCompositionLogfont(LOGFONT *logfont)          break;      } -    logfont->lfHeight = mPreeditor->getPreeditFontSize(); +    if (mPreeditor) +    { +        logfont->lfHeight = mPreeditor->getPreeditFontSize(); +    } +    else +    { +        // todo: extract from some font * LLUI::getScaleFactor() intead +        logfont->lfHeight = 10; +    }      logfont->lfWeight = FW_NORMAL;  } | 
