Skip to content

Commit a83e646

Browse files
committed
Revert "[linux] enabled global menubar on Ubuntu"
This reverts commit 3e750c5.
1 parent 787abe5 commit a83e646

File tree

8 files changed

+4
-679
lines changed

8 files changed

+4
-679
lines changed

docs/References/Menu.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ See [Customize Menubar](../For Users/Advanced/Customize Menubar.md) for detailed
5959

6060
* `option` `{Object}` _Optional_
6161
- `type` `{String}` _Optional_ two types are accepted by this method: "menubar" or "contextmenu". The value is set to "contextmenu" by default.
62-
- `global` `{Boolean}` _Optional_ *(Linux Only)* specify if using global menubar on Ubuntu. It will fallback to local window based menubar if no global menubar available. The value is set to `false` by default.
6362

6463
Create a `Menu` object.
6564

src/api/menu/menu.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ class Menu : public Base {
135135
// rebuild the menu before next show.
136136
bool is_menu_modified_;
137137

138-
bool is_global_menu_bar_;
139-
140138
std::unique_ptr<MenuDelegate> menu_delegate_;
141139
std::unique_ptr<ui::NwMenuModel> menu_model_;
142140
#endif

src/api/menu/menu_views.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ void Menu::Create(const base::DictionaryValue& option) {
6060
focus_manager_ = NULL;
6161
window_ = NULL;
6262

63-
is_global_menu_bar_ = false;
64-
option.GetBoolean("global", &is_global_menu_bar_);
63+
std::string type;
6564

6665
menu_items_.empty();
6766
}

src/api/nw_window_api.cc

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
#include "content/nw/src/api/nw_current_window_internal.h"
2828

29-
#include "chrome/browser/ui/webui/print_preview/print_preview_handler.h"
30-
3129
#if defined(OS_WIN)
3230
#include <shobjidl.h>
3331
#include <dwmapi.h>
@@ -44,9 +42,6 @@
4442

4543
#if defined(OS_LINUX)
4644
#include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
47-
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
48-
#include "ui/aura/window.h"
49-
#include "content/nw/src/browser/global_menu_bar_x11.h"
5045
#endif
5146

5247
#if defined(OS_LINUX) || defined(OS_WIN)
@@ -59,6 +54,8 @@ using nw::BrowserViewLayout;
5954
#include "content/nw/src/nw_content_mac.h"
6055
#endif
6156

57+
#include "chrome/browser/ui/webui/print_preview/print_preview_handler.h"
58+
6259
using content::RenderWidgetHost;
6360
using content::RenderWidgetHostView;
6461
using content::WebContents;
@@ -330,14 +327,6 @@ bool NwCurrentWindowInternalClearMenuFunction::RunAsync() {
330327
#endif
331328

332329
#if defined(OS_LINUX) || defined(OS_WIN)
333-
334-
#if defined(OS_LINUX)
335-
if (nw::GlobalMenuBarX11::IsGlobalMenuBarEnabled()) {
336-
views::DesktopWindowTreeHostX11 *host = static_cast<views::DesktopWindowTreeHostX11*>(window->GetNativeWindow()->GetHost());
337-
host->SetGlobalMenu(nullptr);
338-
}
339-
#endif
340-
341330
native_app_window::NativeAppWindowViews* native_app_window_views =
342331
static_cast<native_app_window::NativeAppWindowViews*>(
343332
window->GetBaseWindow());
@@ -380,26 +369,16 @@ bool NwCurrentWindowInternalSetMenuFunction::RunNWSync(base::ListValue* response
380369
native_app_window::NativeAppWindowViews* native_app_window_views =
381370
static_cast<native_app_window::NativeAppWindowViews*>(
382371
window->GetBaseWindow());
383-
menu->UpdateKeys( native_app_window_views->widget()->GetFocusManager() );
384-
385-
#if defined(OS_LINUX)
386-
if (menu->is_global_menu_bar_ && nw::GlobalMenuBarX11::IsGlobalMenuBarEnabled()) {
387-
views::DesktopWindowTreeHostX11 *host = static_cast<views::DesktopWindowTreeHostX11*>(window->GetNativeWindow()->GetHost());
388-
host->SetGlobalMenu(menu->model());
389-
response->Append(std::unique_ptr<base::ListValue>(new base::ListValue()));
390-
return true;
391-
}
392-
#endif
393372

394373
MenuBarView* menubar = new MenuBarView();
395374
static_cast<BrowserViewLayout*>(native_app_window_views->GetLayoutManager())->set_menu_bar(menubar);
396375
native_app_window_views->AddChildView(menubar);
397376
menubar->UpdateMenu(menu->model());
398377
native_app_window_views->layout_();
399378
native_app_window_views->SchedulePaint();
379+
menu->UpdateKeys( native_app_window_views->widget()->GetFocusManager() );
400380
response->Append(std::unique_ptr<base::ListValue>(new base::ListValue()));
401381
#endif
402-
403382
return true;
404383
}
405384

src/browser/global_menu_bar_registrar_x11.cc

Lines changed: 0 additions & 143 deletions
This file was deleted.

src/browser/global_menu_bar_registrar_x11.h

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)