Merge branch 'master' into rename-to-electron

This commit is contained in:
Cheng Zhao 2015-04-12 21:49:08 +08:00
commit 43fe82e1e5
46 changed files with 1033 additions and 1364 deletions

View file

@ -4,9 +4,10 @@
#include "atom/browser/atom_browser_main_parts.h"
#include <gio/gio.h>
#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "library_loaders/libgio.h"
#include "ui/gfx/switches.h"
namespace atom {
@ -16,8 +17,8 @@ namespace {
const char* kInterfaceSchema = "org.gnome.desktop.interface";
const char* kScaleFactor = "scaling-factor";
bool SchemaExists(const LibGioLoader& libgio_loader, const char* schema_name) {
const gchar* const* schemas = libgio_loader.g_settings_list_schemas();
bool SchemaExists(const char* schema_name) {
const gchar* const* schemas = g_settings_list_schemas();
while (*schemas) {
if (strcmp(schema_name, static_cast<const char*>(*schemas)) == 0)
return true;
@ -26,9 +27,8 @@ bool SchemaExists(const LibGioLoader& libgio_loader, const char* schema_name) {
return false;
}
bool KeyExists(const LibGioLoader& libgio_loader, GSettings* client,
const char* key) {
gchar** keys = libgio_loader.g_settings_list_keys(client);
bool KeyExists(GSettings* client, const char* key) {
gchar** keys = g_settings_list_keys(client);
if (!keys)
return false;
@ -45,24 +45,15 @@ bool KeyExists(const LibGioLoader& libgio_loader, GSettings* client,
}
void GetDPIFromGSettings(guint* scale_factor) {
LibGioLoader libgio_loader;
// Try also without .0 at the end; on some systems this may be required.
if (!libgio_loader.Load("libgio-2.0.so.0") &&
!libgio_loader.Load("libgio-2.0.so")) {
VLOG(1) << "Cannot load gio library. Will fall back to gconf.";
return;
}
GSettings* client = nullptr;
if (!SchemaExists(libgio_loader, kInterfaceSchema) ||
!(client = libgio_loader.g_settings_new(kInterfaceSchema))) {
if (!SchemaExists(kInterfaceSchema) ||
!(client = g_settings_new(kInterfaceSchema))) {
VLOG(1) << "Cannot create gsettings client.";
return;
}
if (KeyExists(libgio_loader, client, kScaleFactor))
*scale_factor = libgio_loader.g_settings_get_uint(client, kScaleFactor);
if (KeyExists(client, kScaleFactor))
*scale_factor = g_settings_get_uint(client, kScaleFactor);
g_object_unref(client);
}

View file

@ -54,8 +54,9 @@
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/screen.h"
#include "ui/gl/gpu_switching_manager.h"
#if defined(OS_WIN)
#include "ui/gfx/switches.h"
@ -65,10 +66,6 @@ using content::NavigationEntry;
using content::RenderWidgetHostView;
using content::RenderWidgetHost;
namespace content {
CONTENT_EXPORT extern bool g_use_transparent_window;
}
namespace atom {
namespace {
@ -115,7 +112,7 @@ NativeWindow::NativeWindow(content::WebContents* web_contents,
// Tell the content module to initialize renderer widget with transparent
// mode.
content::g_use_transparent_window = transparent_;
ui::GpuSwitchingManager::SetTransparent(transparent_);
// Read icon before window is created.
options.Get(switches::kIcon, &icon_);

View file

@ -17,7 +17,7 @@
<key>CFBundleIconFile</key>
<string>atom.icns</string>
<key>CFBundleVersion</key>
<string>0.22.3</string>
<string>0.23.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.8.0</string>
<key>NSMainNibFile</key>

View file

@ -50,8 +50,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,22,3,0
PRODUCTVERSION 0,22,3,0
FILEVERSION 0,23,0,0
PRODUCTVERSION 0,23,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -68,12 +68,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "GitHub, Inc."
VALUE "FileDescription", "Atom-Shell"
VALUE "FileVersion", "0.22.3"
VALUE "FileVersion", "0.23.0"
VALUE "InternalName", "atom.exe"
VALUE "LegalCopyright", "Copyright (C) 2013 GitHub, Inc. All rights reserved."
VALUE "OriginalFilename", "atom.exe"
VALUE "ProductName", "Atom-Shell"
VALUE "ProductVersion", "0.22.3"
VALUE "ProductVersion", "0.23.0"
VALUE "SquirrelAwareVersion", "1"
END
END