Refactor for M98

This commit is contained in:
Alexander David Frick 2021-11-11 11:16:22 -06:00 committed by GitHub
parent 9ab75d567f
commit 73beb12f03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/trace_event.h"
#include "base/values.h"
#include "build/build_config.h"
@ -615,9 +616,18 @@ bool HasWMSpecProperty(const base::flat_set<x11::Atom>& properties,
}
bool GetCustomFramePrefDefault() {
return false;
// _NET_WM_MOVERESIZE is needed for frame-drag-initiated window movement.
if (!WmSupportsHint(x11::GetAtom("_NET_WM_MOVERESIZE")))
return false;
ui::WindowManagerName wm = GuessWindowManager();
// If we don't know which WM is active, conservatively disable custom frames.
if (wm == WM_OTHER || wm == WM_UNNAMED)
return false;
// Stacking WMs should use custom frames.
return !IsWmTiling(wm);
}
bool IsWmTiling(WindowManagerName window_manager) {