Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Update Windows titlebar code to ignore AltGr #4628

Merged
merged 1 commit into from
Oct 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/common/constants/keyLocations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const keyLocations = {
DOM_KEY_LOCATION_STANDARD: 0,
DOM_KEY_LOCATION_LEFT: 1,
DOM_KEY_LOCATION_RIGHT: 2,
DOM_KEY_LOCATION_STANDARD: 3,
}

module.exports = keyLocations
2 changes: 1 addition & 1 deletion app/renderer/components/menubar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Immutable = require('immutable')
const ImmutableComponent = require('../../../js/components/immutableComponent')
const windowActions = require('../../../js/actions/windowActions')
const separatorMenuItem = require('../../common/commonMenu').separatorMenuItem
const keyCodes = require('../../../js/constants/keyCodes')
const keyCodes = require('../../common/constants/keyCodes')
const {wrappingClamp} = require('../../common/lib/formatUtil')

const bindClickHandler = (contextMenu, lastFocusedSelector) => {
Expand Down
2 changes: 1 addition & 1 deletion js/components/addEditBookmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Dialog = require('./dialog')
const Button = require('./button')
const windowActions = require('../actions/windowActions')
const appActions = require('../actions/appActions')
const KeyCodes = require('../constants/keyCodes')
const KeyCodes = require('../../app/common/constants/keyCodes')
const siteTags = require('../constants/siteTags')
const settings = require('../constants/settings')
const siteUtil = require('../state/siteUtil')
Expand Down
2 changes: 1 addition & 1 deletion js/components/autofillAddressPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Dialog = require('./dialog')
const Button = require('./button')
const windowActions = require('../actions/windowActions')
const appActions = require('../actions/appActions')
const KeyCodes = require('../constants/keyCodes')
const KeyCodes = require('../../app/common/constants/keyCodes')

class AutofillAddressPanel extends ImmutableComponent {
constructor () {
Expand Down
2 changes: 1 addition & 1 deletion js/components/autofillCreditCardPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Dialog = require('./dialog')
const Button = require('./button')
const windowActions = require('../actions/windowActions')
const appActions = require('../actions/appActions')
const KeyCodes = require('../constants/keyCodes')
const KeyCodes = require('../../app/common/constants/keyCodes')

class AutofillCreditCardPanel extends ImmutableComponent {
constructor () {
Expand Down
2 changes: 1 addition & 1 deletion js/components/contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Immutable = require('immutable')
const ImmutableComponent = require('./immutableComponent')
const windowActions = require('../actions/windowActions')
const cx = require('../lib/classSet')
const KeyCodes = require('../constants/keyCodes')
const KeyCodes = require('../../app/common/constants/keyCodes')
const {formatAccelerator} = require('../../app/common/lib/formatUtil')
const separatorMenuItem = require('../../app/common/commonMenu').separatorMenuItem

Expand Down
2 changes: 1 addition & 1 deletion js/components/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

const React = require('react')
const ImmutableComponent = require('./immutableComponent')
const KeyCodes = require('../constants/keyCodes')
const KeyCodes = require('../../app/common/constants/keyCodes')

/**
* Represents a popup dialog
Expand Down
2 changes: 1 addition & 1 deletion js/components/findbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const React = require('react')
const ImmutableComponent = require('./immutableComponent')
const Immutable = require('immutable')
const keyCodes = require('../constants/keyCodes')
const keyCodes = require('../../app/common/constants/keyCodes')
const Button = require('./button')
const SwitchControl = require('../components/switchControl')
const windowActions = require('../actions/windowActions')
Expand Down
2 changes: 1 addition & 1 deletion js/components/loginRequired.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const React = require('react')
const Dialog = require('./dialog')
const Button = require('./button')
const appActions = require('../actions/appActions')
const KeyCodes = require('../constants/keyCodes')
const KeyCodes = require('../../app/common/constants/keyCodes')
const url = require('url')

class LoginRequired extends React.Component {
Expand Down
8 changes: 7 additions & 1 deletion js/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ const messages = require('../constants/messages')
const settings = require('../constants/settings')
const siteTags = require('../constants/siteTags')
const dragTypes = require('../constants/dragTypes')
const keyCodes = require('../constants/keyCodes')
const keyCodes = require('../../app/common/constants/keyCodes')
const keyLocations = require('../../app/common/constants/keyLocations')
const isWindows = process.platform === 'win32'

// State handling
Expand Down Expand Up @@ -131,6 +132,11 @@ class Main extends ImmutableComponent {
const customTitlebar = this.customTitlebar
switch (e.which) {
case keyCodes.ALT:
// Ignore right alt (AltGr)
if (e.location === keyLocations.DOM_KEY_LOCATION_RIGHT) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat I didn't even know this existed.

break
}

e.preventDefault()

if (getSetting(settings.AUTO_HIDE_MENU)) {
Expand Down
2 changes: 1 addition & 1 deletion js/components/popupWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const React = require('react')
const ReactDOM = require('react-dom')
const ImmutableComponent = require('./immutableComponent')
const cx = require('../lib/classSet')
const KeyCodes = require('../constants/keyCodes')
const KeyCodes = require('../../app/common/constants/keyCodes')
const windowActions = require('../actions/windowActions')

/**
Expand Down
2 changes: 1 addition & 1 deletion js/components/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const urlParse = require('url').parse
const ImmutableComponent = require('./immutableComponent')
const windowActions = require('../actions/windowActions')
const appActions = require('../actions/appActions')
const KeyCodes = require('../constants/keyCodes')
const KeyCodes = require('../../app/common/constants/keyCodes')
const cx = require('../lib/classSet')
const ipc = global.require('electron').ipcRenderer

Expand Down