Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 481836 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-11 / +42 lines)
Line  Link Here
0
-- brackets-shell/appshell/client_handler_gtk.cpp
0
++ brackets-shell/appshell/client_handler_gtk.cpp
Lines 5-16 Link Here
5
#include <gtk/gtk.h>
5
#include <gtk/gtk.h>
6
#include <X11/Xlib.h>
6
#include <X11/Xlib.h>
7
#include <string>
7
#include <string>
8
#include <gtk-2.0/gtk/gtksignal.h>
9
#include <glib-2.0/gobject/gsignal.h>
8
#include "client_handler.h"
10
#include "client_handler.h"
9
#include "include/cef_browser.h"
11
#include "include/cef_browser.h"
10
#include "include/cef_frame.h"
12
#include "include/cef_frame.h"
13
#include "include/cef_app.h"
11
14
12
// The global ClientHandler reference.
15
// The global ClientHandler reference.
13
extern CefRefPtr<ClientHandler> g_handler;
16
extern CefRefPtr<ClientHandler> g_handler;
17
18
extern bool isReallyClosing;
14
19
15
void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
20
void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
16
                                    CefRefPtr<CefFrame> frame,
21
                                    CefRefPtr<CefFrame> frame,
Lines 29-40 Link Here
29
void ClientHandler::OnTitleChange(CefRefPtr<CefBrowser> browser,
34
void ClientHandler::OnTitleChange(CefRefPtr<CefBrowser> browser,
30
                                  const CefString& title) {
35
                                  const CefString& title) {
31
  REQUIRE_UI_THREAD();
36
  REQUIRE_UI_THREAD();
37
  std::string titleStr(title);
32
38
33
  GtkWidget* window = gtk_widget_get_ancestor(
39
  // Retrieve the X11 display shared with Chromium.
34
      GTK_WIDGET(browser->GetHost()->GetWindowHandle()),
40
  ::Display* display = cef_get_xdisplay();
35
      GTK_TYPE_WINDOW);
41
  DCHECK(display);
36
  std::string titleStr(title);
42
37
  gtk_window_set_title(GTK_WINDOW(window), titleStr.c_str());
43
  // Retrieve the X11 window handle for the browser.
44
  ::Window window = browser->GetHost()->GetWindowHandle();
45
  DCHECK(window != kNullWindowHandle);
46
47
  // Retrieve the atoms required by the below XChangeProperty call.
48
  const char* kAtoms[] = {
49
    "_NET_WM_NAME",
50
    "UTF8_STRING"
51
  };
52
  Atom atoms[2];
53
  int result = XInternAtoms(display, const_cast<char**>(kAtoms), 2, false,
54
                            atoms);
55
  if (!result)
56
    NOTREACHED();
57
58
  // Set the window title.
59
  XChangeProperty(display,
60
                  window,
61
                  atoms[0],
62
                  atoms[1],
63
                  8,
64
                  PropModeReplace,
65
                  reinterpret_cast<const unsigned char*>(titleStr.c_str()),
66
                  titleStr.size());
67
68
  // TODO(erg): This is technically wrong. So XStoreName and friends expect
69
  // this in Host Portable Character Encoding instead of UTF-8, which I believe
70
  // is Compound Text. This shouldn't matter 90% of the time since this is the
71
  // fallback to the UTF8 property above.
72
  XStoreName(display, browser->GetHost()->GetWindowHandle(), titleStr.c_str());
38
}
73
}
39
74
40
void ClientHandler::SendNotification(NotificationType type) {
75
void ClientHandler::SendNotification(NotificationType type) {
Lines 62-72 Link Here
62
  else
97
  else
63
    gtk_widget_set_sensitive(GTK_WIDGET(m_ForwardHwnd), false);
98
    gtk_widget_set_sensitive(GTK_WIDGET(m_ForwardHwnd), false);
64
#endif // SHOW_TOOLBAR_UI
99
#endif // SHOW_TOOLBAR_UI
65
}
66
67
void ClientHandler::CloseMainWindow() {
68
  // TODO(port): Check if this is enough
69
  gtk_main_quit();
70
}
100
}
71
101
72
void ClientHandler::ComputePopupPlacement(CefWindowInfo& windowInfo)
102
void ClientHandler::ComputePopupPlacement(CefWindowInfo& windowInfo)
Lines 101-103 Link Here
101
    // TODO
131
    // TODO
102
    return false;
132
    return false;
103
}
133
}
134

Return to bug 481836