Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 6153714

Browse files
nethipswmitra
authored andcommitted
[Linux only] CEF Upgrade to 2785 (#626)
* Force HiDPI to scale factor 1.0 for now on Linux * Linux only: Changes required for CEF 2785 Integration * 1) Removed force-device-scale-factor code\n 2) Introduced Delayed resize to repaginate view port content 3) Change the minor version of CEF to 1486 * Removing unused variable. * Address review comments. * Reverting the space change.
1 parent 908ed15 commit 6153714

File tree

5 files changed

+48
-4
lines changed

5 files changed

+48
-4
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = function (grunt) {
3838
}
3939

4040
if (platform === "linux") {
41-
cef_version = "3.2704.1414";
41+
cef_version = "3.2785.1486";
4242
}
4343

4444
grunt.initConfig({

appshell/appshell_extensions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,5 +942,8 @@ if (!appshell.app) {
942942

943943

944944
// Alias the appshell object to brackets. This is temporary and should be removed.
945-
brackets = appshell;
945+
// The following is now moved to Global.js as newer versions of CEF crash upon
946+
// eval of this statement.
947+
//brackets = appshell;
948+
946949
})();

appshell/browser/root_window_gtk.cc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,46 @@ void RootWindowGtk::CreateRootWindow(const CefBrowserSettings& settings) {
360360
}
361361
}
362362

363+
// The following function makes sure we repaginate
364+
// the content once the window is shown first. The
365+
// problem was that the view port was not getting
366+
// updated and a fake resize was required for the
367+
// content to repaginate.
368+
void DelayedResize(GtkWidget* window_) {
369+
if(window_){
370+
GtkWindow* window = GTK_WINDOW(window_);
371+
GdkWindow* gdk_window = gtk_widget_get_window(window_);
372+
373+
gint x;
374+
gint y;
375+
gint width;
376+
gint height;
377+
gint depth;
378+
379+
gdk_window_get_geometry (gdk_window,
380+
&x,
381+
&y,
382+
&width,
383+
&height,
384+
&depth);
385+
386+
// A hack to repaginate the content inside the window.
387+
// Nudge the width and height by one pixel, so that the
388+
// resize is not noticeable.
389+
gdk_window_resize (gdk_window, width + 1, height + 1);
390+
}
391+
}
392+
363393
void RootWindowGtk::OnBrowserCreated(CefRefPtr<CefBrowser> browser) {
364394
REQUIRE_MAIN_THREAD();
365395

366396
// For popup browsers create the root window once the browser has been
367397
// created.
368398
if (is_popup_)
369399
CreateRootWindow(CefBrowserSettings());
400+
401+
// Post a message to CEF queue for delated resize.
402+
CefPostTask(TID_UI, base::Bind(&DelayedResize, window_));
370403
}
371404

372405
void RootWindowGtk::OnBrowserWindowDestroyed() {

appshell/client_handler.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ bool ClientHandler::OnDragEnter(CefRefPtr<CefBrowser> browser,
202202
}
203203

204204
void ClientHandler::OnLoadStart(CefRefPtr<CefBrowser> browser,
205-
CefRefPtr<CefFrame> frame) {
205+
CefRefPtr<CefFrame> frame
206+
#ifdef OS_LINUX
207+
,TransitionType transition_type
208+
#endif
209+
) {
206210
CEF_REQUIRE_UI_THREAD();
207211

208212
if (m_BrowserId == browser->GetIdentifier() && frame->IsMain()) {

appshell/client_handler.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser,
126126

127127
// CefLoadHandler methods
128128
virtual void OnLoadStart(CefRefPtr<CefBrowser> browser,
129-
CefRefPtr<CefFrame> frame) OVERRIDE;
129+
CefRefPtr<CefFrame> frame
130+
#ifdef OS_LINUX
131+
,TransitionType transition_type
132+
#endif
133+
) OVERRIDE;
130134
virtual void OnLoadEnd(CefRefPtr<CefBrowser> browser,
131135
CefRefPtr<CefFrame> frame,
132136
int httpStatusCode) OVERRIDE;

0 commit comments

Comments
 (0)