ScreenHelperGTK is the platform dependent part of the original
nsScreenManagerGtk and nsScreenGtk. It registers monitors-changed
event listener from gtk and pushes updates to ScreenManager. See patch
part 4. for how ScreenManager works.
MozReview-Commit-ID: KBo7ZLFTjM3
--HG--
rename : widget/gtk/nsScreenManagerGtk.cpp => widget/gtk/ScreenHelperGTK.cpp
rename : widget/gtk/nsScreenManagerGtk.h => widget/gtk/ScreenHelperGTK.h
extra : rebase_source : 5607e31b62c928934cc45df7b2212428fbfd79c1
It's not used anywhere. Remove it will make removing PScreenManager
easier.
MozReview-Commit-ID: 5dn8kDhTZVl
--HG--
extra : rebase_source : 96b8ddb18deee94ca256bfa118b60ceacfd2d677
to follow the behavior of version 3.20 GtkRange's contents_gadget.
MozReview-Commit-ID: BQE6mQqsan8
--HG--
extra : rebase_source : ee0f35da45f3da2248f50ee925fb7f8e9b848636
in determining breadth of trough and scrollbar.
MozReview-Commit-ID: 3orNXdv6uZh
--HG--
extra : rebase_source : ad840ac199569da2e2fed7aa5e37ecc48a022fe2
This was used with GTK2, but is now unnecessary as discussed in bug 1278282.
moz_gtk_init() is now called from only one place and so will be called only
once.
MozReview-Commit-ID: 2KwJop6qsV9
--HG--
extra : rebase_source : 5649f34914f03f8285eeaad7937d1ecab853649d
Changes in behavior are intended to be minimal, but this adds distinct
metrics for horizontal and vertical scrollbars even with GTK versions < 3.20.
Updates on theme changes will be restored in a subsequent patch.
MozReview-Commit-ID: 4vi2nKxCxW7
--HG--
extra : rebase_source : 5e968126af00a7c1ff0a45d2ba3b46a0a20424be
There is no need to calculate thumb borders because thumb border-box sizes are
determined with GetMinimumWidgetSize, which includes GTK margin, border, and
padding, and the interior border width is irrelevant because thumbs have no
children.
MozReview-Commit-ID: K2N2RBJBRsB
--HG--
extra : rebase_source : c750cdf9c9722f7796c89b8083bf2bfd32fffcbb
Shift+F10 is also well-known shortcut key on Linux. So, it should behave same as pressing ContextMenu key. So, for allowing web page to prevent its default, nsWindow for GTK needs to consume Shift key state at dispatching eContextMenu key.
Additionally, we should allow to open context menu with Shift+ContextMenu because only ContextMenu key press can be prevented its default by web page. Therefore, we should allow users to open context menu even with keyboard even if web content doesn't want it.
Note that Ctrl+Shift+F10 or Alt+Shift+F10 should behave same as Shift+ContextMenu key, but we should discuss later.
MozReview-Commit-ID: 1mPGKMTsrkv
--HG--
extra : rebase_source : 75dd8333b24f5e2f4ded4414b5e5ee85de253cc7
get_gtk_cursor attempts to use themed cursor icons for most css cursor types,
but left these two out. Now it will try to use the theme for these as well,
and fall back to the generic FF set used previously.
MozReview-Commit-ID: 9QHV0mc5AxK
--HG--
extra : rebase_source : c03d01f6dc3a30a8f16def9f95cee14d18f7a8a1
Bug 1343075 - 1a. Add TextEventDispatcherListener::GetIMEUpdatePreference; r=masayuki
Add a GetIMEUpdatePreference method to TextEventDispatcherListener to
optionally control which IME notifications are received by NotifyIME.
This patch also makes nsBaseWidget forward its GetIMEUpdatePreference
call to the widget's native TextEventDispatcherListener.
Bug 1343075 - 1b. Implement GetIMEUpdatePreference for all TextEventDispatcherListener; r=masayuki
This patch implements GetIMEUpdatePreference for all
TextEventDispatcherListener implementations, by moving previous
implementations of nsIWidget::GetIMEUpdatePreference.
Bug 1343075 - 2. Allow setting a PuppetWidget's native TextEventDispatcherListener; r=masayuki
In PuppetWidget, add getter and setter for the widget's native
TextEventDispatcherListener. This allows overriding of PuppetWidget's
default IME handling. For example, on Android, the PuppetWidget's native
TextEventDispatcherListener will communicate directly with Java IME code
in the main process.
Bug 1343075 - 3. Add AIDL interface for main process; r=rbarker
Add AIDL definition and implementation for an interface for the main
process that child processes can access.
Bug 1343075 - 4. Set Gecko thread JNIEnv for child process; r=snorp
Add a JNIEnv* parameter to XRE_SetAndroidChildFds, which is used to set
the Gecko thread JNIEnv for child processes. XRE_SetAndroidChildFds is
the only Android-specific entry point for child processes, so I think
it's the most logical place to initialize JNI.
Bug 1343075 - 5. Support multiple remote GeckoEditableChild; r=esawin
Support remote GeckoEditableChild instances that are created in the
content processes and connect to the parent process GeckoEditableParent
through binders.
Support having multiple GeckoEditableChild instances in GeckoEditable by
keeping track of which child is currently focused, and only allow
calls to/from the focused child by using access tokens.
Bug 1343075 - 6. Add method to get GeckoEditableParent instance; r=esawin
Add IProcessManager.getEditableParent, which a content process can call
to get the GeckoEditableParent instance that corresponds to a given
content process tab, from the main process.
Bug 1343075 - 7. Support GeckoEditableSupport in content processes; r=esawin
Support creating and running GeckoEditableSupport attached to a
PuppetWidget in content processes.
Because we don't know PuppetWidget's lifetime as well as nsWindow's,
when attached to PuppetWidget, we need to attach/detach our native
object on focus/blur, respectively.
Bug 1343075 - 8. Connect GeckoEditableSupport on PuppetWidget creation; r=esawin
Listen to the "tab-child-created" notification and attach our content
process GeckoEditableSupport to the new PuppetWidget.
Bug 1343075 - 9. Update auto-generated bindings; r=me
The new names make it clearer that these actions apply to just one thread.
- profiler_sleep_start() --> profiler_thread_sleep()
- profiler_sleep_end() --> profiler_thread_wake()
- profiler_is_sleeping() --> profiler_thread_is_sleeping()
- GeckoProfilerSleepRAII --> GeckoProfilerThreadSleepRAII
- GeckoProfilerWakeRAII --> GeckoProfilerThreadWakeRAII
Currently, we use alias NS_VK_* for WidgetKeyboardEvent::mKeyCode. Similarly, we should create alias enum for nsIDOMKeyEvent::DOM_KEY_LOCATION_*. Then, we can reduce the length and avoid to include nsIDOMKeyEvent in some cpp files.
MozReview-Commit-ID: 5cs4zQ061Lc
--HG--
extra : rebase_source : e6a6edd27718b9e3d4a40b07902d029791876999
This is consistent with GTK not setting these flags with GtkTextView
and GtkScrolledWindow.
The active flag was triggering @selected_bg_color with Ambiance.
This patch almost reverts the state flags to the logic prior to
cd7544affe40 but keeps the focused flag in the scrolled window.
MozReview-Commit-ID: IVY1sI2Hllw
--HG--
extra : rebase_source : 5774af02f7b6abfeab15bee5f35d941490c81514
We were miscounting the number of manual configure events which we
needed to send gtk as the workaround for bug 1225044, causing it not
to work in some cases. This is because configure events can come from
more sources than were counting.
Decrement mPendingConfigures only as far as zero, like
configure_request_count in gtk_window_configure_event().
MozReview-Commit-ID: GxpR2Zozxor
--HG--
extra : rebase_source : 9d02c4d019d8bea7a07c20fb1435d2f677ae6e28
This is needed for GTK themes with non-zero trough-border such as Greybird.
MozReview-Commit-ID: 8ERxq5Nia6F
--HG--
extra : rebase_source : 5e235b6ae9aab334b57a1f669c835eecbb6563fa
This is necessary for GTK versions > 3.18 because windows no
longer clear their backgrounds since
https://git.gnome.org/browse/gtk+/commit/?id=580ea227a6bb19ad6c6d4766b3a36dbad24583f3
and Ambiance for 3.20 has a transparent background for the "text" window.
See bug 1324262.
MozReview-Commit-ID: 7HCCwfOv0LP
--HG--
extra : rebase_source : 3f4311bb976b3b7c6f17702688437c20395a4454
This is necessary for GTK versions > 3.18 because windows no
longer clear their backgrounds since
https://git.gnome.org/browse/gtk+/commit/?id=580ea227a6bb19ad6c6d4766b3a36dbad24583f3
and Ambiance for 3.20 has a transparent background for the "text" window.
See bug 1324262.
MozReview-Commit-ID: FL16Gx1EQR
--HG--
extra : rebase_source : 59eeaef6b7b62a27ec7d729f26e526da51c9f32e
The style context for MOZ_GTK_TEXT_VIEW is now created by copying from the
widget instead of caching a widget and using its context.
No rendering changes are expected, unless themes are animating GtkTextView
backgrounds.
MozReview-Commit-ID: 9aW61kMkKcb
--HG--
extra : rebase_source : 279c8b15e58c3f0fff51f41a4afacfebfbfa5739
This patch changes it from |NS_IMETHOD| to |virtual nsresult| because some call
sites are checked and others aren't.
--HG--
extra : rebase_source : 6723b9db709d1506dd394b1e85572309c1c2e2cf
This patch changes one from |NS_IMETHOD| to |virtual nsresult| and the other to
|virtual void|.
--HG--
extra : rebase_source : 55af71c01dc75d6bf7c63191e9cfabc9f5368ffa
This patch changes it from |NS_IMETHOD| to |virtual void|. The return value was
only checked in one low-value assertion and one other place where the check had
no useful effect (in nsCocoaWindow::HideWindowChrome()).
--HG--
extra : rebase_source : f6671e9e0e10ee18fb32f8b1c83f1e64c3d97e67
This patch changes it from |NS_IMETHOD| to |virtual void|. The return value was
only checked in one low-value assertion so I decided it wasn't needed.
--HG--
extra : rebase_source : 3523d9a086cf98c40d237d777f5dd471af0d7465
This adjustment is required for changes to MOZ_GTK_TEXT_VIEW in a6aabcb07a6e.
MOZ_GTK_TEXT_VIEW_TEXT now retrieves the equivalent node from WidgetStyleCache.
MozReview-Commit-ID: 2zfHCKMT0ov
--HG--
extra : rebase_source : 39edee068f44cf9d2f6cccffc89dcd7c2c2616d5
This patch changes it from |NS_IMETHOD| to |virtual void| because every
implementation of these functions always returns |NS_OK|.
--HG--
extra : rebase_source : 07ee29c514bf35b97d7195c53bb5b9220d1ef961
This patch changes them from |NS_IMETHOD| to |virtual void| because every
implementation of these functions always returns |NS_OK|.
--HG--
extra : rebase_source : 6207df5a46aeb6b8aaa0f697447a51bc6a6dc366
This patch does the following.
- Removes the return value, because none of the call sites check it.
- Removes the empty implementations from the android nsIWidget instance,
because it can use the nsBaseWidget one.
--HG--
extra : rebase_source : 0791d3cb05907d6b41879549b52f3a33018abf45
This patch removes its return value, because none of the call sites check it
except for one non-vital assertion.
--HG--
extra : rebase_source : 3471c4e22394b8a05c6708d0f8469686ffad9814
This patch does the following.
- Removes the return value, because none of the call sites check it.
- Removes the empty implementations from several nsIWidget instances, because
they can use the nsBaseWidget one.
--HG--
extra : rebase_source : a1a04193bc3940f1468c7c235f6d6e0341d0f1c2
Specifically: OnDefaultButtonLoaded, AttachNativeKeyEvent, BeginMoveDrag,
BeginResizeDrag, GetAttention. These are all fallible functions whose result is
always checked.
The patch also moves some trivial function definitions from nsBaseWidget.cpp to
nsBaseWidget.h, and removes the android BeginResizeDrag() because it can
use the nsBaseWidget one.
--HG--
extra : rebase_source : ef32a41b547bcbc21f7df0043f683307470b136e
This completes the migration of code from the github branch to the graphics
project repo. At this point all webrender-related code should be disabled
unless --enable-webrender is provided in the mozconfig.
MozReview-Commit-ID: Dea8rxM6UPL
This is necessary for GTK to match CSS rules against classes on ancestor nodes
of style contexts constructed from paths.
It can be tested with the following in ~/.config/gtk-3.0/gtk.css
tooltip.background label {padding: 100px;}
MozReview-Commit-ID: EUQ9ndeSl1Z
--HG--
extra : rebase_source : 95c267c5495791a40e755aacf14a80c750fbedd2
This makes balancing with gtk_style_context_restore()/ReleaseStyleContext()
unnecessary, and the style resolution cached in the style contexts is not
invalidated so frequently.
MozReview-Commit-ID: BKwyqoQsjv2
--HG--
extra : rebase_source : 2091fc84a9ecb8b55e7d3e36e72cbd03ea826ac8
The same name is retained for moz_gtk_widget_paint(), which is now more
consistent.
MozReview-Commit-ID: 9RtW66JQVGX
--HG--
extra : rebase_source : 3067daa4e9347cf689e9dccbd7e07578b52cf59c
instead of using the context belonging to a widget.
Only the style context is cached, instead of the whole widget.
Using the style context from a widget meant that rendering displayed the
initial appearance of animations after state changes, but there was no
invalidation to trigger the final rendering in the animations.
Style contexts constructed from paths do not incorporate animations.
(See gtk_css_path_node_update_style() in GTK.) Therefore they provide the
appropriate rendering for Gecko's model, which is not expecting animations.
There is no mechanism available to display animations when using style
contexts constructed from paths, but the GtkWidget animation design is also
not suitable for rendering potentially multiple elements each in a different
state of their animation.
This contexts-from-paths approach can be extended also to other widget types,
but this is a smaller change intended for uplift to other branches to address
a regression in menuitem rendering.
MozReview-Commit-ID: EFV7swWQtm4
--HG--
extra : rebase_source : 689f7340007c889ce0eaeb3b4acd228d45ad0d6d
CreateStyleForWidget() then provides the same behavior with
g_style_context_save() as contexts from widget root style nodes.
MozReview-Commit-ID: 6lRCp3XOoRr
--HG--
extra : rebase_source : ad161eef11e0dc70c8a487c204f109eceac3b1c4
This is necessary to switch from caching GtkWidgets to caching
GtkStyleContexts only.
MozReview-Commit-ID: 6Rwinr4AY8l
--HG--
extra : rebase_source : 930a501b3ecd5f124631e3f96fd6ca7611d078ff
The GtkContainer border-width property defaults to zero. It is not influenced
by theme CSS. While theme engines can theoretically modify default values for
properties of any class, I don't think that is something that needs to be
supported.
Removing this code is necessary to switch from caching GtkWidgets to caching
GtkStyleContexts only.
MozReview-Commit-ID: IxgM8qjfK3a
--HG--
extra : rebase_source : c5c94c19227d7e7d31c4a094bb4fb68f094ddb50
We will use the new type for the generated IPDL message handler
prototype to make sure correct error handling method is called.
MozReview-Commit-ID: AzVbApxFGZ0
Some themes do not draw the "border" subnode, but instead draw a border on the
frame root node.
MozReview-Commit-ID: Fx67mQhhYmz
--HG--
extra : rebase_source : 150168171d521df2c603541e33b10ca287b26b43
Tooltip widget is made in GTK3 as following tree:
* Tooltip window
* Horizontal Box
* Icon (not supported by Firefox)
* Label
Each element can be fully styled by CSS of GTK theme so we have to draw all
elements with appropriate offset and full box model.
MozReview-Commit-ID: E9yYd5UWBu4
--HG--
extra : amend_source : 99539e914e8d3fa07f6bed8a315e40c7d593f277
In GTK 3.20, gtk_menu_item_draw() just draws the root widget gadget, depending
on the theme to style menu items with CSS name "separator" appropriately.
MozReview-Commit-ID: 6AIxPzFe0Rg
--HG--
extra : rebase_source : 58a1ab4c78d94cf186e923354332ecb30aa491f8
This was needed in GTK2 to get the style of the widget, but styles are almost
independent of widgets with GTK3, where realizing is not necessary to get the
style context.
MozReview-Commit-ID: GtL2FLDl9uA
--HG--
extra : rebase_source : 926e6b7fee9a15fe5c86be7327c60b146db11316
This follows the same approach of considering block flow for all widgets
(in addition to resizers) as done for other toolkits in
https://hg.mozilla.org/mozilla-central/rev/4a65cacf8a37#l3.10
MozReview-Commit-ID: Ca3SMs1k2Tj
--HG--
extra : rebase_source : 9845e676aa2db5eecd222b7e8a678b2aecca659e
This converts |nsITransferable.flavorsTransferableCanExport| and
|nsITransferable.flavorsTransferableCanImport| to return a |nsIArray|.
|nsIFormatConverter.getInputDataFlavors| and
|nsIFormatConverter.getOutputDataFlavors| are updated as well.
The Gtk 3.20 scrollbars has moved towards usual box model. The scrollbar,
trough,thumb and scrollbar button can now have margin, padding and border set,
different for each direction (ie. left, right, bottom, top). The scrollbar
metrics become ignored in Gtk 3.20 and later.
* Draw scrollbar element [for GTK 3.20+]
* The border for scrollbar, trough, thumb and scrollbar buttons is newly
calculated as margin+padding+border [for GTK 3.20+].
* The margin is subtracted for scrollbar, trough and sb buttons during paint
function [for GTK 3.6+]
* All scrollbar widget's borders transfered from
nsNativeThemeGTK::GetWidgetBorder to the moz_gtk_get_widget_border.
* Added helper function NativeThemeToGtkTheme for mapping mozilla's widget type
to the gtk widget type.
* Scrollbar troughs are now drawn even when there is not enough room for
the thumb [GTK 3.20+]
MozReview-Commit-ID: jd2q67gKM1
--HG--
extra : rebase_source : ecc8b85401845113d84c6c5a48219a0c3d4f8de3
Change only right arrows to left arrows when direction is RTL
MozReview-Commit-ID: 3mMCAGCIUYP
--HG--
extra : rebase_source : 54fb3bc6455f2117cb0ddae06c4f895f58204d0f
extra : amend_source : 1398b66e4184c71755801c94ecdc2c22ab961ec0
extra : histedit_source : c17fae6ae45191a685af4274d5a6789fb040d691
Using direction-changed signal, we detect keyboard change for bidi.
When system uses fcitx's IM and ibus's arabic keyboard layout, this signal might fire often when switching layout and gdk_keymap_get_direction might return invalid bidi information. But I think that this is rare issue. Most users don't use Firefox Arabic version (it means that bidi.browser.ui = true) with ibus Arabic layout and fcitx CJK IM. Since there is no GTK3 API to get current IM module, I cannot find workaround for this.
MozReview-Commit-ID: DL8uUXJFWYz
--HG--
extra : rebase_source : a93e8969b878d01048726e03b24f362ead7e2059
Using direction-changed signal, we detect keyboard change for bidi.
When system uses fcitx's IM and ibus's arabic keyboard layout, this signal might fire often when switing layout and gdk_keymap_get_direction might return invalid bidi infromation. But I think that this is rare issue. Most users don't use Firefox Arabic version (it means that bidi.browser.ui = true) with ibus arabic layout and fcitx CJK IM. Since there is no GTK3 API to get current IM module, I cannot find workaround for this.
MozReview-Commit-ID: DL8uUXJFWYz
--HG--
extra : rebase_source : 18b7d5c84f48acd62fa14e21a67b711106fb7d63