diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index bf52f1459b..0983102ac6 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -53159,6 +53159,15 @@ void TextEditor::colourChanged() repaint(); } +void TextEditor::lookAndFeelChanged() +{ + if (isCaretVisible()) + { + setCaretVisible (false); + setCaretVisible (true); + } +} + void TextEditor::setCaretVisible (const bool shouldCaretBeVisible) { if (shouldCaretBeVisible && ! isReadOnly()) @@ -53439,7 +53448,7 @@ void TextEditor::updateTextHolderSize() const int h = topIndent + roundToInt (jmax (i.lineY + i.lineHeight, currentFont.getHeight())); - textHolder->setSize (w + 2, h + 1); + textHolder->setSize (w + 2, h + 1); // (the +2 allows a bit of space for the cursor to be at the right-hand-edge) } } @@ -71132,6 +71141,14 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, static_cast (static_cast (dragImageComponent))->updateLocation (false, lastMouseDown); dragImageComponent->setVisible (true); + + #if JUCE_WIN32 + // Under heavy load, the layered window's paint callback can often be lost by the OS, + // so forcing a repaint at least once makes sure that the window becomes visible.. + ComponentPeer* const peer = dragImageComponent->getPeer(); + if (peer != 0) + peer->performAnyPendingRepaintsNow(); + #endif } } @@ -246560,8 +246577,9 @@ public: void performAnyPendingRepaintsNow() { MSG m; - if (component->isVisible() && PeekMessage (&m, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE)) - DispatchMessage (&m); + if (component->isVisible() + && (PeekMessage (&m, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE) || isUsingUpdateLayeredWindow())) + handlePaintMessage(); } static Win32ComponentPeer* getOwnerOfWindow (HWND h) throw() diff --git a/juce_amalgamated.h b/juce_amalgamated.h index cd0f67d0ec..5e5fa64943 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -73,7 +73,7 @@ namespace JuceDummyNamespace {} */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 56 +#define JUCE_BUILDNUMBER 57 /** Current Juce version number. @@ -42206,20 +42206,18 @@ public: /** Deletes all the text from the editor. */ void clear(); - /** Deletes the currently selected region, and puts it on the clipboard. - + /** Deletes the currently selected region. + This doesn't copy the deleted section to the clipboard - if you need to do that, call copy() first. @see copy, paste, SystemClipboard */ void cut(); - /** Copies any currently selected region to the clipboard. - + /** Copies the currently selected region to the clipboard. @see cut, paste, SystemClipboard */ void copy(); /** Pastes the contents of the clipboard into the editor at the cursor position. - @see cut, copy, SystemClipboard */ void paste(); @@ -42349,6 +42347,8 @@ public: /** @internal */ void colourChanged(); /** @internal */ + void lookAndFeelChanged(); + /** @internal */ bool isTextInputActive() const; /** This adds the items to the popup menu. @@ -42402,8 +42402,7 @@ protected: /** Used internally to dispatch a text-change message. */ void textChanged(); - /** Begins a new transaction in the UndoManager. - */ + /** Begins a new transaction in the UndoManager. */ void newTransaction(); /** Used internally to trigger an undo or redo. */ diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index 8dc15cabab..89f7df6c91 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -33,7 +33,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 56 +#define JUCE_BUILDNUMBER 57 /** Current Juce version number. diff --git a/src/gui/components/controls/juce_TextEditor.cpp b/src/gui/components/controls/juce_TextEditor.cpp index 10637c6a32..cd77ef2f12 100644 --- a/src/gui/components/controls/juce_TextEditor.cpp +++ b/src/gui/components/controls/juce_TextEditor.cpp @@ -1138,6 +1138,15 @@ void TextEditor::colourChanged() repaint(); } +void TextEditor::lookAndFeelChanged() +{ + if (isCaretVisible()) + { + setCaretVisible (false); + setCaretVisible (true); + } +} + void TextEditor::setCaretVisible (const bool shouldCaretBeVisible) { if (shouldCaretBeVisible && ! isReadOnly()) diff --git a/src/gui/components/controls/juce_TextEditor.h b/src/gui/components/controls/juce_TextEditor.h index 268c20cf3c..34df931925 100644 --- a/src/gui/components/controls/juce_TextEditor.h +++ b/src/gui/components/controls/juce_TextEditor.h @@ -385,20 +385,18 @@ public: /** Deletes all the text from the editor. */ void clear(); - /** Deletes the currently selected region, and puts it on the clipboard. - + /** Deletes the currently selected region. + This doesn't copy the deleted section to the clipboard - if you need to do that, call copy() first. @see copy, paste, SystemClipboard */ void cut(); - /** Copies any currently selected region to the clipboard. - + /** Copies the currently selected region to the clipboard. @see cut, paste, SystemClipboard */ void copy(); /** Pastes the contents of the clipboard into the editor at the cursor position. - @see cut, copy, SystemClipboard */ void paste(); @@ -530,6 +528,8 @@ public: /** @internal */ void colourChanged(); /** @internal */ + void lookAndFeelChanged(); + /** @internal */ bool isTextInputActive() const; //============================================================================== @@ -585,8 +585,7 @@ protected: /** Used internally to dispatch a text-change message. */ void textChanged(); - /** Begins a new transaction in the UndoManager. - */ + /** Begins a new transaction in the UndoManager. */ void newTransaction(); /** Used internally to trigger an undo or redo. */ diff --git a/src/gui/components/mouse/juce_DragAndDropContainer.cpp b/src/gui/components/mouse/juce_DragAndDropContainer.cpp index aa039c4ed7..62def6971a 100644 --- a/src/gui/components/mouse/juce_DragAndDropContainer.cpp +++ b/src/gui/components/mouse/juce_DragAndDropContainer.cpp @@ -396,6 +396,14 @@ void DragAndDropContainer::startDragging (const String& sourceDescription, static_cast (static_cast (dragImageComponent))->updateLocation (false, lastMouseDown); dragImageComponent->setVisible (true); + + #if JUCE_WIN32 + // Under heavy load, the layered window's paint callback can often be lost by the OS, + // so forcing a repaint at least once makes sure that the window becomes visible.. + ComponentPeer* const peer = dragImageComponent->getPeer(); + if (peer != 0) + peer->performAnyPendingRepaintsNow(); + #endif } } diff --git a/src/native/windows/juce_win32_Windowing.cpp b/src/native/windows/juce_win32_Windowing.cpp index 7936401239..09153b9bc7 100644 --- a/src/native/windows/juce_win32_Windowing.cpp +++ b/src/native/windows/juce_win32_Windowing.cpp @@ -814,8 +814,9 @@ public: void performAnyPendingRepaintsNow() { MSG m; - if (component->isVisible() && PeekMessage (&m, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE)) - DispatchMessage (&m); + if (component->isVisible() + && (PeekMessage (&m, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE) || isUsingUpdateLayeredWindow())) + handlePaintMessage(); } //==============================================================================