зеркало из https://github.com/electron/electron.git
linux: No need to remember root item in menubar.
This commit is contained in:
Родитель
7e86e53593
Коммит
1c62211d99
|
@ -162,8 +162,7 @@ void SetMenuItemID(DbusmenuMenuitem* item, int id) {
|
||||||
GlobalMenuBarX11::GlobalMenuBarX11(NativeWindowViews* window)
|
GlobalMenuBarX11::GlobalMenuBarX11(NativeWindowViews* window)
|
||||||
: window_(window),
|
: window_(window),
|
||||||
xid_(window_->GetNativeWindow()->GetHost()->GetAcceleratedWidget()),
|
xid_(window_->GetNativeWindow()->GetHost()->GetAcceleratedWidget()),
|
||||||
server_(NULL),
|
server_(NULL) {
|
||||||
root_item_(NULL) {
|
|
||||||
EnsureMethodsLoaded();
|
EnsureMethodsLoaded();
|
||||||
if (server_new)
|
if (server_new)
|
||||||
InitServer(xid_);
|
InitServer(xid_);
|
||||||
|
@ -187,13 +186,13 @@ void GlobalMenuBarX11::SetMenu(ui::MenuModel* menu_model) {
|
||||||
if (!server_)
|
if (!server_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
root_item_ = menuitem_new();
|
DbusmenuMenuitem* root_item = menuitem_new();
|
||||||
menuitem_property_set(root_item_, kPropertyLabel, "Root");
|
menuitem_property_set(root_item, kPropertyLabel, "Root");
|
||||||
menuitem_property_set_bool(root_item_, kPropertyVisible, true);
|
menuitem_property_set_bool(root_item, kPropertyVisible, true);
|
||||||
BuildMenuFromModel(menu_model, root_item_);
|
BuildMenuFromModel(menu_model, root_item);
|
||||||
|
|
||||||
server_set_root(server_, root_item_);
|
server_set_root(server_, root_item);
|
||||||
g_object_unref(root_item_);
|
g_object_unref(root_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlobalMenuBarX11::InitServer(unsigned long xid) {
|
void GlobalMenuBarX11::InitServer(unsigned long xid) {
|
||||||
|
|
|
@ -63,7 +63,6 @@ class GlobalMenuBarX11 {
|
||||||
int xid_;
|
int xid_;
|
||||||
|
|
||||||
DbusmenuServer* server_;
|
DbusmenuServer* server_;
|
||||||
DbusmenuMenuitem* root_item_;
|
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarX11);
|
DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarX11);
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче