]>
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
7 // Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GTK_PRIVATE_DIALOGCOUNT_H_
12 #define _WX_GTK_PRIVATE_DIALOGCOUNT_H_
16 // This global variable contains the number of currently opened modal dialogs.
17 // When it is non null, the global menu used in Ubuntu Unity needs to be
18 // explicitly disabled as this doesn't currently happen on its own due to a bug
19 // in Unity, see https://bugs.launchpad.net/indicator-appmenu/+bug/674605
21 // For this to work, all modal dialogs must use wxOpenModalDialogLocker class
22 // below to increment this variable while they are indeed being modally shown.
24 // This variable is defined in src/gtk/toplevel.cpp
25 extern int wxOpenModalDialogsCount
;
27 // ----------------------------------------------------------------------------
28 // wxOpenModalDialogLocker: Create an object of this class to increment
29 // wxOpenModalDialogsCount during its lifetime.
30 // ----------------------------------------------------------------------------
32 class wxOpenModalDialogLocker
35 wxOpenModalDialogLocker()
37 wxOpenModalDialogsCount
++;
40 ~wxOpenModalDialogLocker()
42 wxOpenModalDialogsCount
--;
46 wxDECLARE_NO_COPY_CLASS(wxOpenModalDialogLocker
);
49 #endif // _WX_GTK_PRIVATE_DIALOGCOUNT_H_