feat: implement BrowserWindow.moveTop on X11 (#16629)
It was implemented on Mac and Win but not on X11. Tested on Ubuntu 16.04 and 18.04. Also added a unit test in spec/api-browser-window-spec.js. This test BrowserWindow.moveTop verifies that calling moveTop on a window does not give the focus to this window. notes: BrowserWindow.moveTop is now available on Linux/x11 https://github.com/electron/electron/issues/12516
This commit is contained in:
parent
db11b9b13b
commit
27bd47a333
9 changed files with 73 additions and 13 deletions
|
@ -548,11 +548,9 @@ std::vector<int> TopLevelWindow::GetPosition() {
|
|||
return result;
|
||||
}
|
||||
|
||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
||||
void TopLevelWindow::MoveTop() {
|
||||
window_->MoveTop();
|
||||
}
|
||||
#endif
|
||||
|
||||
void TopLevelWindow::SetTitle(const std::string& title) {
|
||||
window_->SetTitle(title);
|
||||
|
@ -1067,9 +1065,7 @@ void TopLevelWindow::BuildPrototype(v8::Isolate* isolate,
|
|||
.SetMethod("setResizable", &TopLevelWindow::SetResizable)
|
||||
.SetMethod("isResizable", &TopLevelWindow::IsResizable)
|
||||
.SetMethod("setMovable", &TopLevelWindow::SetMovable)
|
||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
||||
.SetMethod("moveTop", &TopLevelWindow::MoveTop)
|
||||
#endif
|
||||
.SetMethod("isMovable", &TopLevelWindow::IsMovable)
|
||||
.SetMethod("setMinimizable", &TopLevelWindow::SetMinimizable)
|
||||
.SetMethod("isMinimizable", &TopLevelWindow::IsMinimizable)
|
||||
|
|
|
@ -126,9 +126,7 @@ class TopLevelWindow : public mate::TrackableObject<TopLevelWindow>,
|
|||
void SetResizable(bool resizable);
|
||||
bool IsResizable();
|
||||
void SetMovable(bool movable);
|
||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
||||
void MoveTop();
|
||||
#endif
|
||||
bool IsMovable();
|
||||
void SetMinimizable(bool minimizable);
|
||||
bool IsMinimizable();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue