ports/devel/electron29/files/patch-ui_base_x_x11__util.cc
Hiroki Tagato 0a7da2a732 devel/electron29: add port: Build cross-platform desktop apps with JavaScript, HTML, and CSS
Build cross platform desktop apps with JavaScript, HTML, and CSS.

It's easier than you think.

If you can build a website, you can build a desktop app. Electron is a
framework for creating native applications with web technologies like
JavaScript, HTML, and CSS. It takes care of the hard parts so you can
focus on the core of your application.

WWW: https://electronjs.org/
2024-04-14 18:06:26 +09:00

23 lines
888 B
C++

--- ui/base/x/x11_util.cc.orig 2024-02-21 00:21:15 UTC
+++ ui/base/x/x11_util.cc
@@ -699,4 +699,20 @@ gfx::ImageSkia GetNativeWindowIcon(intptr_t target_win
return gfx::ImageSkia::CreateFrom1xBitmap(result);
}
+gfx::ICCProfile GetICCProfileForMonitor(int monitor) {
+ gfx::ICCProfile icc_profile;
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kHeadless)) {
+ return icc_profile;
+ }
+ std::string atom_name = monitor == 0
+ ? "_ICC_PROFILE"
+ : base::StringPrintf("_ICC_PROFILE_%d", monitor);
+ scoped_refptr<base::RefCountedMemory> data;
+ if (GetRawBytesOfProperty(GetX11RootWindow(), x11::GetAtom(atom_name.c_str()),
+ &data, nullptr)) {
+ icc_profile = gfx::ICCProfile::FromData(data->data(), data->size());
+ }
+ return icc_profile;
+}
+
} // namespace ui