summaryrefslogtreecommitdiff
path: root/vcl/unx
AgeCommit message (Collapse)Author
2020-12-22left/top variable names don't match propertyCaolán McNamara
Change-Id: I3bca14652fba5a3aad9816417ac7f94b8651f3a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108012 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-21Fix reversed values for gtk_container_child_set (vcl/gtk3)Julien Nabet
Change-Id: Ie9597a72380d4c7fe0647a175febfccf362bd20f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108090 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-16tdf#138661 don't emit value-changed when not changed by userCaolán McNamara
in the FormattedSpinButton which is the standard mode for these signals and what the SpinButton does, and in this case the FormattedSpinButton is considered "modified" when it shouldn't be Change-Id: I26865e099c02fdd2745c41b347b7006d8560fb20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107710 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-09tdf#138778 add has_child_focus which considers a related popup a 'child'Caolán McNamara
Change-Id: Iab23e399f2650ece702fb1f62d1387acca472b42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107480 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-09unref pSubMenuModel at the end of the scopeCaolán McNamara
Change-Id: Ia427c736f989de38f30c455aeed0f43811a456b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107474 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-09leaked_storageCaolán McNamara
Change-Id: I462636907a7f16a69d2fae2529c6ffbbf925774b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107391 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-03Add 'SinglePrintJobs' to PrintOptionsSamuel Mehrbrodt
So that this option can be set via UNO API Change-Id: I0b69162661a4327d59aaed82d5eff98cb50d852c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106593 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 2e2c162b7a816d990415fca434e6d3d5600b2858) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106677 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-12-01tdf#132350 gtk: implement extra update button in menubarCaolán McNamara
Change-Id: I00c91c3b0ee1fd2ebfb3662bae2caf79962654f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106943 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-26keep toolitem ids uniqueCaolán McNamara
which is a problem when we swap item ids under SAL_RTL_ENABLED=1 in sidebars Change-Id: Ib949f7836893b2f06b748fc3a2546788555782ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106674 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-25tdf#138425 vcl/gtk activate main menu in UpdateFullThomas Viehmann
VCL GTK (in contrast to X11 and apparently Windows) pre-activates popup menus in GtkSalMenu::UpdateFull by calling GtkSalMenu::ActivateAllSubmenus. Before this patch, this, called on the main menu, would not activate the main menu itself (which does get activated in X11 eventually). This patch changes the logic to also activate the main menu. This patch deals only with gtk3. A followup patch would do the analogous change in the VCL Qt5 plugin in Qt5Menu::DoFullMenuUpdate. I haven't discovered yet where this type of functionality is currently tested, so sadly I don't have an idea how to test this and so didn't include a test case. Change-Id: I6cd9929acfd3b3af731bbc62d649d643044ca692 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106454 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit cbc18cc904c652a936c4b68fba4d975bd89b5abd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106583
2020-11-23tdf#137662 ignore focus in dropdown if dropdown is hiddenCaolán McNamara
Change-Id: I0263fb832f31c6926ac63cab79ce8fd0b9548581 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106244 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-22tdf#123936 Formatting files in module vcl with clang-formatPhilipp Hofer
Change-Id: Ia162ad5b7499c0ddfdbfca59ae76b81335ce2d45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105728 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2020-11-20If we grab focus to a GtkToolbar then focus a GtkToolbarItem childCaolán McNamara
and consider focus in a GtkToolbar child as focus the GtkToolbar has focus Change-Id: Id3299dd9246da22b21b3e1a347faff8bc867c438 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106270 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-20GtkWindow case is similar to GtkPopover caseCaolán McNamara
Change-Id: Ie7417efd4113851615ee1c17a1297017a49a992d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106268 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-19tdf#138010 (II) getNativeControlRegion (gtk3/kf5): Consider frame's borderMichael Weghorn
Take the frame border/padding into account when calculating the content rectangle (i.e. the area that can safely be drawn into without overlapping the actual frame) when calculating dimensions in 'getNativeControlRegion' regardless of the exact 'DrawFrameFlags' being passed. Previously, gtk3 and qt5 only did this when the 'DrawFrameFlags::NoDraw' flag was passed in addition, but the actual drawing routine 'drawNativeControl' does not make any such distinction, so the frame ended up at a place that was still in the "content rectangle" as calculated previously (which was the same as the bounding rect). Returning the actual content rect is a prerequisite for making 'VclScrolledWindow' take the width of a natively drawn frame into account, which will be done in a follow-up commit. Change-Id: I8d3a3fbd387108a24a0478e3465c8950e6d59735 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106155 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-11-19Update ident<->toolitem mapping in set_item_identCaolán McNamara
Change-Id: I477b2171bf8da38fb6f403d8618c0f3815fdd984 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106160 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-18Remove unused SalGtkFilePicker::implAddFilterGroup _rFilter parameterStephan Bergmann
unused ever since at least e335eb1438ed99260a5ca050548b2693b5b22b1c "gtk3: move gtk+ file picker into vcl - a more sensible place for it" Change-Id: Ib8687b113f4a66e500a0787511125bac8c08e3fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106050 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-17loplugin:stringviewparam check methods tooNoel
not just functions Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-17tdf#138183 sync pending clipboard assign on clipboard ownership-changeCaolán McNamara
Change-Id: I325add499fbd4d11a942ce550346dcbcb5343e4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105928 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-16check TopLevelMenuHelper for existenceCaolán McNamara
Change-Id: I84e0893b1ca271cd7460e8fb0ce20b91bf3e58d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105903 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-15add Menu::get_idCaolán McNamara
Change-Id: I608db63f700312f7d7ffc6bfbd0e03971bfb00e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105845 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-14remove SalPointNoel Grandin
<caolan> that "SalPoint" doesn't really seem to to have a purpose except to highlight that "Point" is assumed to use LONG under windows and can be passed unchanged to those windows drawing apis <caolan> so I guess remove SalPoint entirely, use Point instead, and convert to "POINT" under windows ? Change-Id: Ic15a7f4516e2075a228fa65cac4e8494d5b3abaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105634 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-13add set_accessible_descriptionCaolán McNamara
Change-Id: I18aebc4a127ff92f5d2606490e4f120d4b98b4ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105796 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-13tdf#138047 wait until map to disable the parent SalFrame tab-cyclingCaolán McNamara
because the original parent is changed before the popup appears and the wrong SalFrame is affected Change-Id: I4dbf50c6bac063b7730f5b6c0f388b4983e0866c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105735 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-12New loplugin:stringviewparamStephan Bergmann
...to "Find functions that take rtl::O[U]String parameters that can be generalized to take std::[u16]string_view instead." (Which in turn can avoid costly O[U]String constructions, see e.g. loplugin:stringview and subView.) Some of those functions' call sites, passing plain char string literals, needed to be adapted when converting them. Change-Id: I644ab546d7a0ce9e470ab9b3196e3e60d1e812bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105622 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-11support getting Expander's labelCaolán McNamara
Change-Id: Ibd3fe335e645895eedb6330cfc98590ad3c31fb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105578 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-11loplugin:stringviewNoel
Add new methods "subView" to O(U)String to return substring views of the underlying data. Add a clang plugin to warn when replacing existing calls to copy() would be better to use subView(). Change-Id: I03a5732431ce60808946f2ce2c923b22845689ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105420 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11convert more long -> tools::LongNoel
found by grepping and changed by hand. Change-Id: I3c720859dba430fde3abc76c6c5cb58269efaf4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105512 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11support changing Expander's labelCaolán McNamara
Change-Id: I9a7945f6bc1ed176dc4662571ebd876b61662e2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105568 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-10sync the vcl expander default with the gtk one to !m_bResizeTopLevelCaolán McNamara
Change-Id: Ia186514efa9e670ce2287201f16978fc1b0e9146 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105564 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-10GtkExpander, like GtkCalendar needs to not let click through to vclCaolán McNamara
Change-Id: Ieccc019b423aa9271ce45a002672893c38f1986b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105562 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-09Resolves: tdf#137786 allow 'toggling' GtkToolButtonsCaolán McNamara
even if they are not GtkToggleToolButtons We already allow this for GtkMenuToolButton, we shouldn't need to allow it for a GtkToolButton because a GtkToggleToolButton should be used. But we have inconsistency where some of these 'align' features are considered toggleable by some apps or modes within an app and not by others. So when this inconsistency arises reuse the pseudo-toggle support for GtkMenuToolButton for GtkToolButton. Change-Id: I78b625b206bf6187e36fc39f876d4828ada10a7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105476 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-06Revert "loplugin:stringbuffer"Noel Grandin
This reverts commit f0356b6128bb4e78041d53025ad7c2e0b8e0c299. Reason for revert: There is a OUStringConcat overload for OUStringBuffer which would have kicked in here, so this is unnecessary Change-Id: I3bafb6c30bd3a2c1912daf227554889f1e09c78a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105354 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-06Resolves: tdf#137181 set the clipboard asynchronouslyCaolán McNamara
because apparently hitting the wayland compositor repeatedly with clipboard changes without a chance of reply triggers a "Lost connection to Wayland compositor" failure, so make it happen on the next event loop and have only one event pending Change-Id: I24d22e70f5f614fa0c9d3d1672e064d9c57be57e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105339 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-06loplugin:stringbufferNoel
Change-Id: Id6f7268f12eb728dbb255aa19cd590b6813c4f01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105377 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-05gtk3: Allow restoring saved window position (if not on Wayland)Michael Weghorn
Previously, while 'GtkInstanceWindow::get_window_state' returned the window position for the non-Wayland case, 'GtkInstanceWindow::set_window_state' didn't take it into account when restoring the state. In order to actually restore the previously saved state, have 'GtkInstanceWindow::set_window_state' take the window position into account as well if the corresponding flags are passed (and not on Wayland). This e.g. makes the print dialog show up at the same position on the screen as last time. (I came across this while looking at tdf#137471 "CMIS dialog advances beyond lower right corner of the screen" which affects qt5, and checking what gtk3 does in comparison. Actually, the "Remote files" dialog itself - other than the print dialog - still doesn't open at the same location with this commit in place, since 'GtkInstanceWindow::get_window_state' for some reason doesn't return the actual location for that dialog, i.e. it cannot be restored by the handling introduced here, but that's a different issue.) Change-Id: Icb5e7e8c7ea3fad7800c4334ad56e47f88144a75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105298 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-11-05Related: tdf#137181 factor out the piece that triggers the problemCaolán McNamara
Change-Id: Ic74f7c972988d6a26f7e5e34354fe05da4601f41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105338 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-05SpinButtonEntry is unusedNoel
since commit f2517e82904b92989ed7e38a070c18234f460b33 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Tue Sep 8 22:11:11 2020 +0200 improve loplugin:unusedvarsglobal Change-Id: Ibfa5a651eae01aeecd77a46d9f949ae6e48e17fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105304 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-04Fix typosAndrea Gelmini
Change-Id: I8a7a313b54aafc5347e00c5afec4648e09dbc981 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105295 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-11-04resource leakCaolán McNamara
Change-Id: I1abd8acef55d5bdb4744ecf1a62d8e1396de0e3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105287 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-03loplugin:unusedfieldsNoel
Change-Id: Ia8e2a7ce75bfded98e85fa583d1404710069d335 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105249 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-02Better types for SystemGraphicsData::hDrawable, cairo::X11SysData::hDrawableStephan Bergmann
Both apparently only hold X11 Drawable values. But include/vcl/sysdata.hxx does not include the X11 include files that would define Drawable, so use sal_uIntPtr there, which is also used for other similar SystemEnvData and SystemParentData aWindow members there. Change-Id: Ia136ad1937e2009eb409c3ef8cc41dc81bd338a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105156 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-01Transport Pixmap from GetNativeSurfaceHandle via css::uno::Any as sal_Int64Stephan Bergmann
The values returned from GetNativeSurfaceHandle are only used in cairocanvas::CanvasBitmap::getFastPropertyValue (canvas/source/cairo/cairo_canvasbitmap.cxx), whose consumers in turn are (at least the ones I could identify): * OGLTransitionerImpl::setSlides (slideshow/source/engine/opengl/TransitionerImpl.cxx), passing the values on to X11SalObject::SetLeaveEnterBackgrounds, which extracts the Pixmap value to pass it on to XSetWindowBackgroundPixmap. * X11SalBitmap::Create (vcl/unx/generic/gdi/salbmp.cxx), which extracts the Pixmap value to pass it on to X11SalBitmap::ImplCreateFromDrawable (as a Drawable) and to XFreePixmap. While Pixmap XIDs are apparently 32-bit in the X11 protocol, see e.g. <https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html>, Xlib and the underlying /usr/include/X11/Xdefs.h appear to be somewhat confused whether the typedef for XID should be unsigned long (presumably stemming from times when long was universally 32-bit) or CARD32, see e.g. <https://gitlab.freedesktop.org /xorg/proto/xorgproto/-/blob/master/include/X11/Xdefs.h>. So conservatively stick to a 64-bit type here, even if it should only ever contain 32-bit values. Change-Id: I26c3a2ff74cef092042a6e3648cd9a6f4a9e3aac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105144 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-31X11Pixmap::mhDrawable only ever holds a PixmapStephan Bergmann
...(passed in in X11Surface::getSimilar at vcl/unx/generic/gdi/cairo_xlib_cairo.cxx:226), so use that for its type. (Using an appropriate UNO type when passing it into an any in X11SalGraphics::GetNativeSurfaceHandle will be addressed in a later commit; lets stick to tools::Long there for now.) Change-Id: I047a5f078c4b3c45a8fdc0fb09d544c73a6a4e29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105087 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-28Related: tdf#137620 focus-in IMHandler on grab_focusCaolán McNamara
Change-Id: I9fa980f500cd11b34e349866e62f9f2399279e5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104932 Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Jenkins
2020-10-28Fix build for UNX x86Thorsten Behrens
Change-Id: I971aa787a33fa3a6bd9913abb94c90ddf53109cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104937 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-10-28convert some more long -> tools::LongNoel
grepping for stuff in template params this time Change-Id: Ia37bfd85480b3a72c3c465489581d56ad8dde851 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104855 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-28std::set->o3tl::sorted_vector in vclNoel Grandin
Change-Id: Ie486b629b4074da5121b55c76965aeb8ea057f31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104904 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-27tdf#133950 scale hotspot to sync with scaled cursorsCaolán McNamara
keep aspect ratio as well Change-Id: Ia3c7f84e377ebb952be0a56e9e532fb260f83459 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104890 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Jenkins
2020-10-27Resolves: tdf#137620 add DeleteSurroundingText at vcl::Window levelCaolán McNamara
a) give it a default implementation based on the current one b) re-use code introduced for WeldEditView::DeleteSurroundingText for the EditView containing vcl::Window in impress/draw and various similar Annotation windows Change-Id: I55547c70e90ee394795b5545450cf8131538fad8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104781 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>