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 );
60 std::string titleStr(title);
63 ::Display *display = cef_get_xdisplay();
67 ::Window window = browser->GetHost()->GetWindowHandle();
68 DCHECK(window != kNullWindowHandle);
71 const char *kAtoms[] = {
"_NET_WM_NAME",
"UTF8_STRING"};
73 int result = XInternAtoms(display,
const_cast<char **
>(kAtoms), 2,
false, atoms);
77 XChangeProperty(display, window, atoms[0], atoms[1], 8, PropModeReplace,
78 reinterpret_cast<const unsigned char *
>(titleStr.c_str()), titleStr.size());
84 XStoreName(display, browser->GetHost()->GetWindowHandle(), titleStr.c_str());
89 ::Display *display = cef_get_xdisplay();
90 if (!display)
return false;
93 ::Window window = browser->GetHost()->GetWindowHandle();
94 if (window == kNullWindowHandle)
99 printf(
" bad window in XResizeWindow\n");
104 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 void PlatformInit()