Commit graph

65 commits

Author SHA1 Message Date
stransky
4f0a73b42b Bug 1726360 [Wayland] Sync clipboard update, r=jhorak
- Allow async data transfer when widget.wayland.async-data-transfer.enabled static is set.
- Return early when fast track request number does not match and don't process such events.
- Use kClipboardFastIterationNum to process fast iterations.

Depends on D123609

Differential Revision: https://phabricator.services.mozilla.com/D123610
2021-08-31 13:08:37 +00:00
Iulian Moraru
cd31ddf343 Backed out 5 changesets (bug 1726360) for causing build bustages on nsClipboardWayland.cpp. CLOSED TREE
Backed out changeset 8dbac57c6d97 (bug 1726360)
Backed out changeset f6a2a6120840 (bug 1726360)
Backed out changeset f1a23246cda9 (bug 1726360)
Backed out changeset 8b0f13706131 (bug 1726360)
Backed out changeset 252a8a030a49 (bug 1726360)
2021-08-27 21:29:18 +03:00
stransky
5d10df7c97 Bug 1726360 [Wayland] Sync clipboard update, r=jhorak
- Allow async data transfer when widget.wayland.async-data-transfer.enabled static is set.
- Return early when fast track request number does not match and don't process such events.
- Use kClipboardFastIterationNum to process fast iterations.

Depends on D123609

Differential Revision: https://phabricator.services.mozilla.com/D123610
2021-08-27 12:55:40 +00:00
stransky
e72d41676c Bug 1725149 [Wayland] Implement async clipboard, r=rmader
When widget.wayland.async-clipboard.enabled use async clipboard and D&D handlers provided by Gtk.

Differential Revision: https://phabricator.services.mozilla.com/D122353
2021-08-12 14:07:58 +00:00
stransky
989e6bc8fc Bug 1722700 [Wayland] Merge WaylandDragAndDropDataOffer and DataOffer classes, r=rmader
Merge WaylandDragAndDropDataOffer and DataOffer classes to avoid potential timing issue when Drag&Drop action is set before WaylandDragAndDropDataOffer is created.

Differential Revision: https://phabricator.services.mozilla.com/D121877
2021-08-05 14:56:08 +00:00
stransky
067315fd58 Bug 1721563 [Wayland] Limit time of reading clipboard data, r=emilio
We're reading clipboard data from fd in non-blocking mode and repeat when data ate not ready.

Modify reading from fd to make sure we don't wait endlessly:

- sleep 20 ms after unsuccessful before next attempt
- limit maximal reading time to 0.5 sec

Differential Revision: https://phabricator.services.mozilla.com/D120667
2021-07-23 10:37:38 +00:00
stransky
1e53409c57 Bug 1721563 [Wayland] Flush wl_display connection before reading clipboard data, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D120658
2021-07-23 10:27:49 +00:00
stransky
5ead475068 Bug 1717476 [Wayland] Imlement async clipboard data get, r=jhorak
Firefox uses synchronized clipboard data get/set which causes issues when clipboard data is transferred in scope of Firefox
itself as getting code blocks the sending one. As a workaround X11 clipboard code runs restricted message loop (processes clipboard events only),
Wayland clipboard handler uses fast (direct) path when clipboard data is owned by Firefox and D&D code runs main loop for some limited time.

When D&D operation is used on Wayland we can't determine clipboard data owner - so we can't use the fast (direct) data transfer but we always
read data from wayland clipboard. That approach block when D&D data comes from Firefox itself.

In orded to fix that this patch does:

- Implement DataOffer::GetDataInternal() as non-blocking, i.e. fail when we can't get data from file descriptor provided by Wayland clipboard code.
- Create new thread and run DataOffer::GetDataInternal() there
- Run limited main event loop as D&D code does.

In order to make the changes possible we also need to better track wayland data offers:

- Implement DataOffer as ref counted general wayland clipboard data placeholder
- Implement WaylandDragAndDropDataOffer for D&D data events
- Track all offers in offer cache (mActiveOffers)

Differential Revision: https://phabricator.services.mozilla.com/D118577
2021-07-20 10:53:31 +00:00
Masayuki Nakano
72856f1661 Bug 1712675 - part 1: Add missing header includes under widget/gtk r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D115977
2021-05-26 22:53:30 +00:00
imoraru
447cb5ed69 Backed out changeset 003fab04d7cc (bug 1703490) for causing Bug 1704287. CLOSED TREE 2021-04-26 16:25:15 +03:00
stransky
d7e38be9ab Bug 1703763 [Wayland] Use fast track clipboard to get clipboard content when clipboard content is owned by Firefox, r=jhorak
Recently we use fast track clipboard shortcut to get clipboard data when clipboard content is owned by Firefox but
we ask Wayland compositor for clipboard content mime types.

That may lead to a bug when Firefox is faster and sets clipboard content internally but Wayland compositor does not have the content yet.
So use fast track to also get clipboard mime types.

Differential Revision: https://phabricator.services.mozilla.com/D111377
2021-04-09 11:33:55 +00:00
stransky
3e1f9057fd Bug 1703490 [Wayland] Remove duplicate Drag&Drop handlers, r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D111072
2021-04-07 12:37:20 +00:00
stransky
2a3383c928 Bug 1635757 [Linux] Remove nsDragService logging module and log D&D with WidgetDrag log module, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D104802
2021-02-16 07:52:36 +00:00
stransky
cf17e8e30d Bug 1631061 [Wayland] Clear clipboard content when gtk_clipboard_request_contents() fails, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D103461
2021-01-29 11:40:27 +00:00
stransky
5d9aa9bb9b Bug 1631061 [Wayland] Add more logging to wayland clipboard code, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D103288
2021-01-28 10:06:15 +00:00
stransky
5b6bd31681 Bug 1688975 [Wayland] Remove poll() from DataOffer::GetData(), r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D103092
2021-01-27 08:55:02 +00:00
Narcis Beleuzu
f2b3650083 Backed out changeset e8c18967320c (bug 1631061) for causing Bug 1683989 2020-12-23 12:50:06 +02:00
stransky
31ad281be6 Bug 1631061 [Wayland] Remove fast track clipboard and always ask compositor for clipboard data, r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D100317
2020-12-22 10:12:01 +00:00
Robert Mader
71f8bab55f Bug 1667674 - [Wayland] Support public primary-selection unstable protocol. r=stransky
This is required to support pasting the primary selection into Firefox on compositors only
supporting the public protocol, such as KWin. Getting the selection *from* Firefox is done
via GTK and will be supported from GTK 3.24.23 on.

The public protocol, while practically identical, will replace the gtk-private one eventually.
However, support for the private one will still be needed for a while.

Note: this also updates the auto-generated gtk-primary-selection files.

Differential Revision: https://phabricator.services.mozilla.com/D91594
2020-10-02 09:13:06 +00:00
Narcis Beleuzu
c3f877ffe4 Backed out changeset 499103fc4ccb (bug 1667674) for bc failures on browser_aboutCertError_offlineSupport.js . CLOSED TREE 2020-09-30 21:50:27 +03:00
Robert Mader
8397a4676b Bug 1667674 - [Wayland] Support public primary-selection unstable protocol. r=stransky
This is required to support pasting the primary selection into Firefox on compositors only
supporting the public protocol, such as KWin. Getting the selection *from* Firefox is done
via GTK and will be supported from GTK 3.24.23 on.

The public protocol, while practically identical, will replace the gtk-private one eventually.
However, support for the private one will still be needed for a while.

Note: this also updates the auto-generated gtk-primary-selection files.

Differential Revision: https://phabricator.services.mozilla.com/D91594
2020-09-30 12:35:49 +00:00
stransky
77af5a272b Bug 1662425 [Wayland] Create nsWaylandDisplay as ref counted, r=jhorak
- Create nsWaylandDisplay as a ref-counted struct to avoid potential delete when a display is used.
- Don't use Mutex to access all display array operations. Use only write mutex when the array is modified / released.
- Store all wayland displays in nsTArray instead of fixed plain C array.
- Release all displays before we close Gtk display to make sure we quit before Gtk connections are closed.

Differential Revision: https://phabricator.services.mozilla.com/D89188
2020-09-04 10:54:49 +00:00
Brindusan Cristian
678576577a Backed out changeset 00a41c5183d7 (bug 1662425) for linux leakcheck failures. CLOSED TREE 2020-09-03 17:15:01 +03:00
stransky
333b3cf8ca Bug 1662425 [Wayland] Create nsWaylandDisplay as ref counted, r=jhorak
- Create nsWaylandDisplay as a ref-counted struct to avoid potential delete when a display is used.
- Don't use Mutex to access all display array operations. Use only write mutex when the array is modified / released.
- Store all wayland displays in nsTArray instead of fixed plain C array.
- Release all displays before we close Gtk display to make sure we quit before Gtk connections are closed.

Differential Revision: https://phabricator.services.mozilla.com/D89188
2020-09-03 13:30:30 +00:00
Martin Stransky
8ee72ddd94 Bug 1635362 [Wayland] Split mozcontainer implementation for X11 and Wayland, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D73794
2020-05-13 13:11:49 +00:00
Dorel Luca
365efa35da Backed out changeset 44d68ed90676 (bug 1635362) for Mochitest failures in browser/browser_Telemetry_timestamp_test.js. CLOSED TREE 2020-05-12 15:50:41 +03:00
Martin Stransky
9273e0a347 Bug 1635362 [Wayland] Split mozcontainer implementation for X11 and Wayland, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D73794
2020-05-12 10:14:21 +00:00
Mihai Alexandru Michis
c48271d35e Backed out changeset 54d6f39b880a (bug 1635362) for causing failures in test_bug659071.html and browser_Telemetry_timestamp_test.js
CLOSED TREE
2020-05-11 17:26:29 +03:00
Martin Stransky
d8946e5c38 Bug 1635362 [Wayland] Split mozcontainer implementation for X11 and Wayland, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D73794
2020-05-11 12:25:58 +00:00
Martin Stransky
cbd149f1b6 Bug 1527976 [Wayland] Don't cancel Drag and Drop on MOZ_GTK_DRAG_RESULT_ERROR for application/x-moz-tabbrowser-tab (tab move), r=jhorak
- X11 uses MOZ_GTK_DRAG_RESULT_NO_TARGET to state 'no place' for drop. Wayland does not have protocol for it and always return MOZ_GTK_DRAG_RESULT_ERROR.
  To emulate X11 behaviour for tab D&D (application/x-moz-tabbrowser-tab mime) don't cancel D&D operation on Wayland for MOZ_GTK_DRAG_RESULT_ERROR
  to allow to create a new tab when user drops tab outside the tab bar.
- Provide some additional loging to D&D code.

Differential Revision: https://phabricator.services.mozilla.com/D70333

--HG--
extra : moz-landing-system : lando
2020-04-09 14:18:41 +00:00
Martin Stransky
3c3825bf9d Bug 1627098 [Linux] Provide more clipboard logging, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D69452

--HG--
extra : moz-landing-system : lando
2020-04-03 07:53:43 +00:00
Eric Rahm
2ebdb299d2 Bug 1623181 - Remove nsAutoPtr usage from widget/gtk. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D67243

--HG--
extra : moz-landing-system : lando
2020-03-18 12:30:50 +00:00
Robert Mader
995e9b73cc Bug 1604048 - Make Wayland DnD behaviour closer match X11's - part 1, r=stransky
- Properly initialize `mSelectedDragAction` of data_offers so `GetSelectedDragAction()`
   does not return random values.
 - Emit a motion event on `data_offer_action`, just like GTK does, to chain up to
   `nsDragService::UpdateDragAction()`
 - Only advertise possible actions if we actually accept them.
 - Rename some things to make them easier to understand

Differential Revision: https://phabricator.services.mozilla.com/D60853

--HG--
extra : moz-landing-system : lando
2020-01-31 11:37:34 +00:00
Gabriele Svelto
5dc21d568c Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55444

--HG--
extra : moz-landing-system : lando
2019-12-06 09:17:57 +00:00
Martin Stransky
59589dad99 Bug 1581638 - Provide logging to Linux/Gtk clipboard code, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D46266

--HG--
extra : moz-landing-system : lando
2019-09-19 07:24:41 +00:00
Martin Stransky
388e4b2d74 Bug 1576268 - [Wayland] Use MOVE as a default Drag and Drop action to match X11 behavior, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D43578

--HG--
extra : moz-landing-system : lando
2019-08-27 12:12:14 +00:00
Martin Stransky
f93809e3ff Bug 1523822 - [Wayland] Get clipboard data again when poll returns EINTR/EAGAIN, r=jld
Differential Revision: https://phabricator.services.mozilla.com/D36454

--HG--
extra : moz-landing-system : lando
2019-07-02 09:00:26 +00:00
Sylvestre Ledru
e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Martin Stransky
1ffeea40ca Bug 1517205 - Make nsWaylandDisplay() global, r=lsalzman
Lazilly create nsWaylandDisplay objects and remove them at Firefox quit.

nsWaylandDisplay objects should stay as global objects and don't be created/released.
The creation/removal wastes resources on server side as the wl_registry objects at nsWaylandDisplay has to be stored at server
side and can't be removed until firefox ends [1] anyway.

Also the removed nsWaylandDisplay causes crashes when display
topology changes due to the global nature of the wl_registry.

[1] https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_registry

Differential Revision: https://phabricator.services.mozilla.com/D26673

--HG--
extra : moz-landing-system : lando
2019-04-09 21:39:51 +00:00
Tooru Fujisawa
7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Ehsan Akhgari
490e611801 Bug 1508472 - Part 5: Fifth batch of comment fix-ups in preparation for the tree reformat r=sylvestre
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal. I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.

Differential Revision: https://phabricator.services.mozilla.com/D13371

--HG--
extra : moz-landing-system : lando
2018-11-29 10:30:46 +00:00
Gabriele Svelto
19e52bebd4 Bug 1510582 - Remove useless inclusions of Services.h r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D13240

--HG--
extra : moz-landing-system : lando
2018-11-28 17:25:23 +00:00
Martin Stransky
786a526298 Bug 1507475 - [Wayland] Implement global wayland registry, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D12255

--HG--
extra : moz-landing-system : lando
2018-11-23 07:04:16 +00:00
Noemi Erli
c00dbe5749 Backed out changeset bafd708f5788 (bug 1507475) for bustages in builds/worker/workspace/build/src/widget/gtk/mozcontainer.cpp CLOSED TREE 2018-11-22 20:09:34 +02:00
Martin Stransky
d78c51a229 Bug 1507475 - [Wayland] Implement global wayland registry, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D12255

--HG--
extra : moz-landing-system : lando
2018-11-22 13:24:09 +00:00
Narcis Beleuzu
67221429e3 Backed out changeset 06d83f08f7a0 (bug 1505164) for bustages on WindowSurfaceWayland.cpp . CLOSED TREE 2018-11-15 22:47:57 +02:00
Martin Stransky
dc82a88ccf Bug 1505164 - Express explicit wailand interface versions r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D11757

--HG--
extra : moz-landing-system : lando
2018-11-15 14:52:04 +00:00
Mike Hommey
ac19b1cd69 Bug 1505023 - Remove unused mKeyboard field after bug 1504689. r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D11135

--HG--
extra : moz-landing-system : lando
2018-11-07 11:43:01 +00:00
Martin Stransky
37cfe5b008 Bug 1504689 - [Wayland/Clipboard] Don't delete clipboard wl_data_offer after keyboard focus out, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D10895

--HG--
extra : moz-landing-system : lando
2018-11-06 10:40:48 +00:00