diff --git a/atom.gyp b/atom.gyp index 0bf9983115c6..5d379fe04dc6 100644 --- a/atom.gyp +++ b/atom.gyp @@ -103,6 +103,7 @@ 'browser/net/url_request_string_job.h', 'browser/ui/accelerator_util.cc', 'browser/ui/accelerator_util.h', + 'browser/ui/accelerator_util_gtk.cc', 'browser/ui/accelerator_util_mac.mm', 'browser/ui/accelerator_util_win.cc', 'browser/ui/atom_event_processing_window.h', diff --git a/browser/ui/accelerator_util_gtk.cc b/browser/ui/accelerator_util_gtk.cc new file mode 100644 index 000000000000..ac14b260be5e --- /dev/null +++ b/browser/ui/accelerator_util_gtk.cc @@ -0,0 +1,20 @@ +// Copyright (c) 2013 GitHub, Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "browser/ui/accelerator_util.h" + +#include "ui/base/accelerators/accelerator.h" +#include "ui/base/accelerators/platform_accelerator_gtk.h" + +namespace accelerator_util { + +void SetPlatformAccelerator(ui::Accelerator* accelerator) { + scoped_ptr platform_accelerator( + new ui::PlatformAcceleratorGtk( + GetGdkKeyCodeForAccelerator(*accelerator), + GetGdkModifierForAccelerator(*accelerator))); + accelerator->set_platform_accelerator(platform_accelerator.Pass()); +} + +} // namespace accelerator_util