Commit graph

378 commits

Author SHA1 Message Date
Shelley Vohr
27bbf6a3c6 feat: add evt listeners for SetAlwaysOnTop (#14951)
* feat: add evt listeners for SetAlwaysOnTop

* only emit one event on AlwaysOnTop change

* docs: add new alwaysontop event

* dont emit if theres no change

* address feedback from review
2018-10-04 13:02:16 -05:00
Troy
560b1c17af fix: setMaximizable to be true if window is resizable & maximizable (#14648)
* setMaximizable to be true if window is resizable & maximizable

* Fix linting

* Add regressive test to verify maxmizable state

* Leaves maximizable state of window alone if setResizable is called

* Fix exclusive test

* Fix crashing text

* SetMaximizable unconditionally

* Remember former maximizable state

* Fix accidental mac variable deletion

* Logic modification

* Lint

* Remove unneeded test

* Remove unneeded variable since only Windows is effect
2018-09-26 11:41:40 +10:00
Charles Kerr
d663b4eaee
fix: fix gn cpplint warnings (#14583)
* chore: fix cpplint 'include_what_you_use' warnings

Typically by including <memory>, <utility> etc.

* chore: fix 'static/global string constant' warning

Use C style strings instead of std::string.

Style guide forbids non-trivial static / global variables. https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables

/home/charles/electron/electron-gn/src/electron/script/cpplint.js

* refactor: remove global string variables.

Fix 'global string variables are not permitted' linter warnings
by using the base::NoDestructor<> wrapper to make it explicit that
these variables are never destroyed.

The style guide's take on globals with nontrivial destructors:
https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables

* fix: initializer error introduced in last commit

* fix: remove WIP file that was included by accident

* fix: include order

* fix: include order

* fix: include order

* fix: include order, again
2018-09-12 19:25:56 -05:00
Nitish Sakhawalkar
e90c281ef3 fix: Windows Background color issue (#14561)
Call InvalidateRect for windows after setting the bg color
2018-09-12 13:41:47 -07:00
Nitish Sakhawalkar
a2ab0d8ebe fix: notify focus change right away rather not on next tick (#14453)
* fix: Notify focus change right away, not on next tick

* fix: emit the JS blur/focus events on next tick to avoid race condition

* address feedback from review

* fix: bind deferred Emit() calls to a WeakPtr

This is so that the deferred Emit() calls will be canceled
if the TopLevelWindow is destroyed.

* chore: remove wip/test code cruft

* fix: make linter happy

* Enable disabled tests

* refactor: cleaner impl of EmitEventSoon()

* Revert "Merge branch 'fix-win-focus' of github.com:electron/electron into fix-win-focus"

This reverts commit 90576806eb271d059f0a215c67e9b4b04f7396a4, reversing
changes made to 9c13e47779a3af78fe0970c1f3d6cd040a5354e6.

* Restore 704722c1, which was removed in error.

We apologise again for the fault in the subtitles. Those responsible for sacking the people who have just been sacked have been sacked.
2018-09-07 13:21:58 -05:00
Paulius
b89848d683 feat: allow window above full screen windows on mac (#14122)
* allow window above full screen windows on mac

* add visibility change params to higher level files

* adress feedback, fix bool issue, remove compilation hooks

* adjust readme

* switch to options object

* single argument for native window views
2018-08-31 15:06:02 -07:00
Emmanuel Kimmerlin
5f6706ac33 feat: BrowserWindow.getNormalBounds() (#13290)
* First commit

* Add Mac support (1st attempt)

* Add Mac support (2nd attempt)

* Simplify tests

* Restore window state !

* Looking at other tests, seems minimize, maximize, fullscreen are skipped when in CI

* Fix Mac tests

* Restore tests in CI

* Fix typo

* widget getRestoredBounds not working on Mac !!

* widget getRestoredBounds not working on Mac !!

* Add IsNormal function

* Add IsNormal

* IsNormal => isNormal

* Deactivate fullscreen on Mac. Do not receive leave-fullscreen event

* Set default original_frame_

* Set default original_frame_

* Fix Mac
2018-08-24 14:33:27 -07:00
Aleksei Kuzmin
d6ffbc0148 Use an int for wm::ShadowElevation. Pick semantic constants.
https://chromium-review.googlesource.com/899886
2018-06-19 11:49:43 +10:00
Aleksei Kuzmin
f6648a0d4d Remove ScopedComPtr and scoped_comptr.h
https://chromium-review.googlesource.com/726461
2018-06-19 11:49:43 +10:00
Aleksei Kuzmin
82d204e932 Wrap X11 headers in ui/gfx/x/x11.h
https://chromium-review.googlesource.com/756711
2018-06-19 11:49:43 +10:00
deepak1556
5df0362361 Remove obsolete ShouldHandleSystemCommands function.
https://chromium-review.googlesource.com/c/chromium/src/+/924315
2018-06-19 11:49:42 +10:00
Milan Burda
2337237d58 Refactoring: use C++11 class member variable initialization 2018-05-22 00:18:38 +02:00
Jeremy Apthorp
da0fd10423 refactor: chromium-style warnings in linux code (#12949) 2018-05-16 14:12:45 -05:00
Cheng Zhao
2f3fcb9dbe give window a default content view
Certain APIs are expecting the window to have a content view, having a
default one simplifies our design.
2018-05-15 14:12:47 +09:00
Cheng Zhao
2b24b26e59 refactor: do not pass WebContents to NativeWindow 2018-05-15 14:03:21 +09:00
Cheng Zhao
c67d1b62e3
refactor: NativeWindowViews should not be a View (#12750) 2018-05-01 13:28:22 +09:00
Cheng Zhao
089428857c remove unnecessary defines 2018-04-30 10:56:54 +09:00
Cheng Zhao
e07ea24610 remove unnecessary static_cast 2018-04-30 10:56:54 +09:00
Cheng Zhao
2225cc9608 refactor: manage widget_ in NativeWindow 2018-04-30 10:56:54 +09:00
Cheng Zhao
727cd68cee refactor: Use widget() instead of window_ 2018-04-30 10:56:54 +09:00
Cheng Zhao
6d18bd0633 refactor: Make NativeWindow inherit WidgetDelegate 2018-04-30 10:56:54 +09:00
Shelley Vohr
c6f4bbd143
also format missing .cc files 2018-04-18 20:48:45 -04:00
Cheng Zhao
56735d4ff5 Add NativeWindow::SetContentView 2018-04-11 15:12:53 +09:00
Cheng Zhao
13473ee138 web_view_ => content_view_ 2018-04-11 15:12:53 +09:00
Cheng Zhao
97e8800677 Remove web_contents from NativeWindow's constructor 2018-04-11 15:12:53 +09:00
Charles Kerr
cad8eed6e4 Use ui:view's Activate() on Linux (#12539)
In NativeWindowViews, we started rolling our own _NET_ACTIVE_WINDOW
event in June 2016 to raise windows because Chromium's implementation
wasn't working as expected. (See commit 32b692b6)

I'm not seeing this behavior in our current version of libcc,
so I wonder if this workaround is still needed?
2018-04-05 22:39:53 -04:00
Cheng Zhao
c75dd93b92
Move AutofillPopup from NativeWindow to WebContents (#12514) 2018-04-05 09:53:51 +09:00
MadfishDT
200388ff96 add moveTop API to move window z-oder to top for win32, mac (#12485)
* add moveTop API to move window z-oder to top for win32, mac

* BrowserWindow::MoveTop SetMethod bug fix
2018-04-03 08:04:32 -05:00
Cheng Zhao
3d47a8a2fd Remove the static getter methods from WebContentsPreferences 2018-03-22 15:20:03 +09:00
Cheng Zhao
887bc12350 Add WebContentsPreferences::From that checks parameter 2018-03-22 15:16:26 +09:00
Cheng Zhao
9772777919 web_prefrences() => dict()
Having property name being the same with class name is making code
harder to understand, and dict is much shorter.
2018-03-22 15:15:30 +09:00
Charles Kerr
558ef7352d
Better GTK+ Menu color support (#12300)
* Better GTK+ Menu color support

 * Fix 'invisible menu' issue (#12275)

 * Now updates menu text color when focus changes!

 * Better caching of colors when system theme changes

 * Removed all GTK+ deprecation warnings from menubar

* Don't highlight menu text on mouseover in GTK+

* Fix textColor declaration scope error

* Simplify FocusManager connection management a bit

* Make the linter happy

* Decouple MenuBar view recoloring from rebuilding

This way we don't need to rebuild the subview each time a recolor
is needed, e.g. when window focus changes or the system theme changes

* Don't iterate child views if we don't need to

* Move variable declaration outside of a loop

* More efficient iteration of MenuBar children

* Cleaner MenuButton bounds testing

* Fix oops

* Add a nullptr check in MenuBar::GetItemCount()

* Simplify iteration in MenuBar::RebuildChildren()

* Make the linter happy

* Fix signed-unsigned comparison

* Remove declarations of nonexistent methods

* Make SubmenuButton accessor const

* Cleaner accelerator iteration

* Windows fixes
2018-03-17 06:37:36 +09:00
Lyall Hamilton
ba24920fec Fix menubar toggle alt key detection on focus
Reset alt keypress flag on window blur so switching window via
Alt+* window manager keybindings can't incedentally trigger
annoying menubar toggles
2018-03-08 21:48:43 +13:00
Cheng Zhao
9000bd6679 views: Explicitly set initially focused view 2018-03-06 16:21:18 +09:00
Cheng Zhao
bf862d1d07 views: Focus webContents in BrowserWindow 2018-03-06 16:21:17 +09:00
Cheng Zhao
3b3e69f8b2 Save browser_view_ in the NativeWindow
No need to store it separately in subclasses.
2018-03-06 16:20:37 +09:00
Cheng Zhao
503b0ba1b1 mac: Move draggable region code to BrowserWindow
On macOS current draggable region implementation highly relies on
WebContents, the code is only meaningful for BrowserWindow.
2018-03-06 16:20:37 +09:00
Cheng Zhao
1681ee35db Set WebContents background color in BrowserWindow 2018-03-06 16:20:37 +09:00
Cheng Zhao
66fab65a1a Add NativeWindowObserver::OnCloseButtonClicked 2018-02-22 19:01:45 +09:00
Cheng Zhao
bffb31c337 Remove OnMessageReceived from NativeWindow 2018-02-22 19:01:45 +09:00
Cheng Zhao
44e7282b4b The UpdateDraggableRegions does not share implementations 2018-02-22 19:01:45 +09:00
Heilig Benedek
50690d25f1 Remove WS_EX_COMPOSITED style from window 2018-01-23 20:14:34 +01:00
Heilig Benedek
d5ab691fdb fix osr devtools crash introduced during merge 2017-12-20 12:57:02 +09:00
Ales Pergl
fd7af5c1d9 Don't call ui::SetAtomArrayProperty with an empty vector (fails DCHECK) 2017-12-01 17:55:22 +01:00
shelley vohr
c18afc924b
Merge pull request #10213 from electron/upgrade-to-chromium-61
[WIP] Upgrade to Chromium 61
2017-11-24 10:17:52 +01:00
Tony Ganch
59550b203f Include objbase.h only for Windows 2017-11-24 10:58:17 +09:00
Tony Ganch
da04cbd4d8 Rename set_background to SetBackground 2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
7f5fbb04e2 Migrate from ScopedComPtr::CreateInstance() to CoCreateInstance in chrome/...
https://codereview.chromium.org/2894483002
2017-11-24 10:58:17 +09:00
Heilig Benedek
bb5eecc16c Use SizeConstraints instead of window events 2017-11-23 21:25:25 +01:00
Cheng Zhao
72440d4ae7 No need to add new methods to WebContentsPreferences 2017-11-13 17:35:49 +09:00