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);
78 if (!result) NOTREACHED();
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());
void PlatformTitleChange(CefRefPtr< CefBrowser > browser, const CefString &title)
static bool PlatformInit()