41
41
#include " TSystem.h"
42
42
#include " TGCocoa.h"
43
43
#include " TROOT.h"
44
+ #include " TGTextView.h"
45
+ #include " TGView.h"
46
+ #include " TGCanvas.h"
44
47
45
48
46
49
namespace ROOT {
@@ -896,7 +899,10 @@ bool ViewIsTextView(unsigned viewID)
896
899
const TGWindow * const window = gClient ->GetWindowById (viewID);
897
900
if (!window)
898
901
return false ;
899
- return window->InheritsFrom (" TGTextView" );
902
+ // This code used to use TObject::InheritsFrom, however since this is
903
+ // run under the AppKit, we can not call core/meta functions, otherwise
904
+ // we will run into deadlocks.
905
+ return dynamic_cast <const TGTextView*>(window);
900
906
}
901
907
902
908
// ______________________________________________________________________________
@@ -916,7 +922,10 @@ bool ViewIsTextViewFrame(NSView<X11Window> *view, bool checkParent)
916
922
if (!window)
917
923
return false ;
918
924
919
- if (!window->InheritsFrom (" TGViewFrame" ))
925
+ // This code used to use TObject::InheritsFrom, however since this is
926
+ // run under the AppKit, we can not call core/meta functions, otherwise
927
+ // we will run into deadlocks.
928
+ if (!dynamic_cast <const TGViewFrame*>(window))
920
929
return false ;
921
930
922
931
if (!checkParent)
@@ -934,7 +943,10 @@ bool ViewIsHtmlView(unsigned viewID)
934
943
const TGWindow * const window = gClient ->GetWindowById (viewID);
935
944
if (!window)
936
945
return false ;
937
- return window->InheritsFrom (" TGHtml" );
946
+ // This code used to use TObject::InheritsFrom, however since this is
947
+ // run under the AppKit, we can not call core/meta functions, otherwise
948
+ // we will run into deadlocks.
949
+ return window->TestBit (TGWindow::kIsHtmlView );
938
950
}
939
951
940
952
// ______________________________________________________________________________
@@ -955,7 +967,10 @@ bool ViewIsHtmlViewFrame(NSView<X11Window> *view, bool checkParent)
955
967
if (!window)
956
968
return false ;
957
969
958
- if (!window->InheritsFrom (" TGViewFrame" ))
970
+ // This code used to use TObject::InheritsFrom, however since this is
971
+ // run under the AppKit, we can not call core/meta functions, otherwise
972
+ // we will run into deadlocks.
973
+ if (!dynamic_cast <const TGViewFrame*>(window))
959
974
return false ;
960
975
961
976
if (!checkParent)
@@ -2705,7 +2720,10 @@ - (void) drawRect : (NSRect) dirtyRect
2705
2720
if (self.fQuartzWindow .fShapeCombineMask )
2706
2721
X11::ClipToShapeMask (self, fContext );
2707
2722
2708
- if (window->InheritsFrom (" TGContainer" ))// It always has an ExposureMask.
2723
+ // This code used to use TObject::InheritsFrom, however since this is
2724
+ // run under the AppKit, we can not call core/meta functions, otherwise
2725
+ // we will run into deadlocks.
2726
+ if (dynamic_cast <const TGContainer*>(window))// It always has an ExposureMask.
2709
2727
vx->GetEventTranslator ()->GenerateExposeEvent (self, [self visibleRect ]);
2710
2728
2711
2729
if (fEventMask & kExposureMask ) {
0 commit comments