File tree 2 files changed +32
-1
lines changed
Siv3D/src/Siv3D-Platform/WindowsDesktop/Siv3D/DragDrop
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -741,14 +741,23 @@ namespace s3d
741
741
742
742
if (FAILED (::RegisterDragDrop (m_hWnd, m_pDropTarget)))
743
743
{
744
- throw EngineError{ U" RegisterDragDrop() failed" };
744
+ LOG_WARNING (U" RegisterDragDrop() failed" );
745
+ }
746
+ else
747
+ {
748
+ m_initialized = true ;
745
749
}
746
750
747
751
m_pDropTarget->Release ();
748
752
}
749
753
750
754
void CDragDrop::update ()
751
755
{
756
+ if (not m_initialized)
757
+ {
758
+ return ;
759
+ }
760
+
752
761
const auto status = m_pDropTarget->getStatus ();
753
762
754
763
const Array<DroppedFilePath>& filePaths = std::get<Array<DroppedFilePath>>(status);
@@ -768,11 +777,21 @@ namespace s3d
768
777
769
778
void CDragDrop::acceptFilePaths (const bool accept)
770
779
{
780
+ if (not m_initialized)
781
+ {
782
+ return ;
783
+ }
784
+
771
785
m_pDropTarget->acceptFilePaths (accept);
772
786
}
773
787
774
788
void CDragDrop::acceptText (const bool accept)
775
789
{
790
+ if (not m_initialized)
791
+ {
792
+ return ;
793
+ }
794
+
776
795
m_pDropTarget->acceptText (accept);
777
796
}
778
797
@@ -829,13 +848,23 @@ namespace s3d
829
848
830
849
void CDragDrop::makeDragDrop (const Array<FilePath>& paths)
831
850
{
851
+ if (not m_initialized)
852
+ {
853
+ return ;
854
+ }
855
+
832
856
std::lock_guard lock{ m_mutex };
833
857
834
858
m_newDragPaths = paths;
835
859
}
836
860
837
861
void CDragDrop::process ()
838
862
{
863
+ if (not m_initialized)
864
+ {
865
+ return ;
866
+ }
867
+
839
868
Array<FilePath> paths;
840
869
841
870
{
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ namespace s3d
57
57
58
58
HWND m_hWnd = nullptr ;
59
59
60
+ bool m_initialized = false ;
61
+
60
62
detail::DropTarget* m_pDropTarget = nullptr ;
61
63
62
64
Array<DroppedFilePath> m_droppedFilePaths;
You can’t perform that action at this time.
0 commit comments