14#pragma GCC diagnostic ignored "-Wunused-parameter"
15#pragma GCC diagnostic ignored "-Wshadow"
20#include "include/cef_config.h"
28#include "include/base/cef_logging.h"
29#include "include/cef_browser.h"
31int x11_errhandler( Display *dpy, XErrorEvent *err )
34 if (err->error_code == BadWindow) {
37 }
else if (err->error_code == BadMatch && err->request_code == 42) {
40 }
else if (err->error_code == BadDrawable && err->request_code == 14) {
46 XGetErrorText( dpy, err->error_code, errstr,
sizeof(errstr) );
47 printf(
"X11 Error: %d opcode: %d info: %s\n", err->error_code, err->request_code, errstr );
54 XSetErrorHandler( x11_errhandler );
64 std::string titleStr(title);
67 ::Display *display = cef_get_xdisplay();
71 ::Window window = browser->GetHost()->GetWindowHandle();
72 DCHECK(window != kNullWindowHandle);
75 const char *kAtoms[] = {
"_NET_WM_NAME",
"UTF8_STRING"};
77 int result = XInternAtoms(display,
const_cast<char **
>(kAtoms), 2,
false, atoms);
81 XChangeProperty(display, window, atoms[0], atoms[1], 8, PropModeReplace,
82 reinterpret_cast<const unsigned char *
>(titleStr.c_str()), titleStr.size());
88 XStoreName(display, browser->GetHost()->GetWindowHandle(), titleStr.c_str());
93 ::Display *display = cef_get_xdisplay();
94 if (!display)
return false;
97 ::Window window = browser->GetHost()->GetWindowHandle();
98 if (window == kNullWindowHandle)
102 if (
result == BadWindow) {
103 printf(
" bad window in XResizeWindow\n");
108 printf(
" bad values in XResizeWindow %d %d\n",
width,
height);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
static bool PlatformResize(CefRefPtr< CefBrowser > browser, int width, int height)
void PlatformTitleChange(CefRefPtr< CefBrowser > browser, const CefString &title)
static bool PlatformInit()