Skip to content
Snippets Groups Projects
Commit 0c97cfe2 authored by Fons Rademakers's avatar Fons Rademakers
Browse files

Avoid DeleteWindow() singleshot timer from being set twice for the same

window (could happen when clicking very quickly twice in the WM close box).
Fixes issue 37197.


git-svn-id: http://root.cern.ch/svn/root/trunk@24081 27541ba8-7e3a-0410-8455-c3a389f83636
parent 2bc8565d
No related branches found
No related tags found
No related merge requests found
...@@ -143,6 +143,8 @@ enum EDNDFlags { ...@@ -143,6 +143,8 @@ enum EDNDFlags {
class TGFrame : public TGWindow, public TQObject { class TGFrame : public TGWindow, public TQObject {
protected: protected:
enum { kDeleteWindowCalled = BIT(15) };
Int_t fX; // frame x position Int_t fX; // frame x position
Int_t fY; // frame y position Int_t fY; // frame y position
UInt_t fWidth; // frame width UInt_t fWidth; // frame width
......
...@@ -250,7 +250,9 @@ void TGFrame::DeleteWindow() ...@@ -250,7 +250,9 @@ void TGFrame::DeleteWindow()
if (gDNDManager->GetMainFrame() == this) if (gDNDManager->GetMainFrame() == this)
gDNDManager->SetMainFrame(0); gDNDManager->SetMainFrame(0);
} }
TTimer::SingleShot(150, IsA()->GetName(), this, "ReallyDelete()"); if (!TestBit(kDeleteWindowCalled))
TTimer::SingleShot(150, IsA()->GetName(), this, "ReallyDelete()");
SetBit(kDeleteWindowCalled);
} }
//______________________________________________________________________________ //______________________________________________________________________________
...@@ -530,9 +532,9 @@ Bool_t TGFrame::HandleEvent(Event_t *event) ...@@ -530,9 +532,9 @@ Bool_t TGFrame::HandleEvent(Event_t *event)
//______________________________________________________________________________ //______________________________________________________________________________
TGDimension TGFrame::GetDefaultSize() const TGDimension TGFrame::GetDefaultSize() const
{ {
// std::cout << fWidth << "x" << fHeight << std::endl; // std::cout << fWidth << "x" << fHeight << std::endl;
return TGDimension(fWidth, fHeight); return TGDimension(fWidth, fHeight);
} }
...@@ -1698,9 +1700,9 @@ const TGPicture *TGMainFrame::SetIconPixmap(const char *iconName) ...@@ -1698,9 +1700,9 @@ const TGPicture *TGMainFrame::SetIconPixmap(const char *iconName)
{ {
// Set window icon pixmap by name. This is typically done via the window // Set window icon pixmap by name. This is typically done via the window
// manager. Icon can be in any image format supported by TImage, e.g. // manager. Icon can be in any image format supported by TImage, e.g.
// GIF, XPM, PNG, JPG .. or even PS, PDF (see EImageFileTypes in TImage.h // GIF, XPM, PNG, JPG .. or even PS, PDF (see EImageFileTypes in TImage.h
// for the full list of supported formats). // for the full list of supported formats).
// //
// For example, // For example,
// main_frame->SetIconPixmap("/home/root/icons/bld_rgb.png"); // main_frame->SetIconPixmap("/home/root/icons/bld_rgb.png");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment