]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/private/dialogcount.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/private/dialogcount.h
3 // Purpose: Helper for temporarily changing wxOpenModalDialogsCount global.
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GTK_PRIVATE_DIALOGCOUNT_H_
11 #define _WX_GTK_PRIVATE_DIALOGCOUNT_H_
15 // This global variable contains the number of currently opened modal dialogs.
16 // When it is non null, the global menu used in Ubuntu Unity needs to be
17 // explicitly disabled as this doesn't currently happen on its own due to a bug
18 // in Unity, see https://bugs.launchpad.net/indicator-appmenu/+bug/674605
20 // For this to work, all modal dialogs must use wxOpenModalDialogLocker class
21 // below to increment this variable while they are indeed being modally shown.
23 // This variable is defined in src/gtk/toplevel.cpp
24 extern int wxOpenModalDialogsCount
;
26 // ----------------------------------------------------------------------------
27 // wxOpenModalDialogLocker: Create an object of this class to increment
28 // wxOpenModalDialogsCount during its lifetime.
29 // ----------------------------------------------------------------------------
31 class wxOpenModalDialogLocker
34 wxOpenModalDialogLocker()
36 wxOpenModalDialogsCount
++;
39 ~wxOpenModalDialogLocker()
41 wxOpenModalDialogsCount
--;
45 wxDECLARE_NO_COPY_CLASS(wxOpenModalDialogLocker
);
48 #endif // _WX_GTK_PRIVATE_DIALOGCOUNT_H_