summaryrefslogtreecommitdiff
path: root/vcl/unx
AgeCommit message (Collapse)AuthorFilesLines
2014-03-14KDE4: prevent blocking in Display::YieldJan-Marek Glogowski1-0/+4
SalX11Display registers a Yield handler, which splits check and and processing into two functions, which both lock the yield mutex. Normally this no problem, but during a Drag'n'Drop operation the D'n'D thread also checks and processes XEvents (for D'n'D). So the XNextEvent in Display::Yield will actually block, if the seen XEvent was for D'n'D and was already processed. Change-Id: I9f8d96d4f9986997cbe150a2b66bc767b4bbc2f1
2014-03-14KDE4: add Qt4 glib ExcludeSocket runtime checkJan-Marek Glogowski6-13/+165
Add a runtime check and configure warning to disable KDE4 native file pickers, if the Qt4 glib dispatcher doesn't honor the QEventLoop::ExcludeSocketNotifiers flag. This way polling the QClipboard using the event loop won't crash LibreOffice with recursive paint events, See https://bugreports.qt-project.org/browse/QTBUG-37380 Change-Id: I5cad30ead74571e49a075c084cca7a19acff7523
2014-03-14KDE4: change eventLoopType enum to glib boolJan-Marek Glogowski2-38/+24
Just check for glib; it's the default in later Qt4 versions on unix. Change-Id: Ia99466e9010eb835bea0c3c4420da3c8b3cd4671
2014-03-14Revert "Rewrite Qt4 based nested yield mutex locking."Jan-Marek Glogowski1-14/+3
This reverts the unx/kde4/KDEXLib.cxx part of commit 13a34f4c6307d1bd2443cbf3fbd83bfdd8cdbafb. Conflicts: vcl/unx/kde4/KDE4FilePicker.cxx vcl/unx/kde4/KDEXLib.cxx Change-Id: Ica8a0f678f080ae7d763bb7da7761d20ceec328c
2014-03-14Revert "fdo#67011: Run Display::Yield through KDEXLib::Yield."Jan-Marek Glogowski1-16/+6
This reverts commit 95f60222e75486336b6569afa8f34d60b51c94ad.
2014-03-14Revert "KDE4: sleep in yield for native file picker"Jan-Marek Glogowski4-28/+5
This reverts commit 380f3b4b6cbbe8e82b58ddf55e95c5005307b51f. Conflicts: vcl/unx/kde4/KDEXLib.cxx vcl/unx/kde4/KDEXLib.hxx Change-Id: I8a201c89be63cebab7401124002261be23e049c7
2014-03-14Resolves: coverity#1078567 help coverity outCaolán McNamara1-4/+3
so it know that its the same rPPDCache in use to avoid various warnings Change-Id: I89cb7830f375f1907b2457bd05fd2df5d36c3696
2014-03-13vcl: prefer passing OUString and OString by referenceNoel Grandin3-3/+3
Change-Id: I6c2c6f597ca62c004ad7dc606cef3a3b10e810b6
2014-03-11coverity#441225 Dereference null return valueCaolán McNamara1-1/+5
Change-Id: I9ff48e869cd03847d5338c5f8fb6acceee522e34
2014-03-10fdo#73115: Always run timeouts as eventsJan-Marek Glogowski1-3/+7
Right-click popup menus run click events throught the LO main loop. In case of KDE4 the LO main loop is run by a timer in the main thread, with Qt::DirectConnection execution. If the timeout actually starts a nested event loop for a new dialog, the timer is blocked, the nested mainloop detects it was started from the timeout and drops the blocked timout from polling, which blocks any further LibreOffice event loop processing. This changes the timers to Qt::QueuedConnection, so they always generate an event and are processed by the Qt event loop. Change-Id: Ie626b22be3d8f9b8934bcc5e9e0e67a365549cfc
2014-03-09Avoid possible resource leaks with boost::scoped_ptrTakeshi Abe2-15/+15
Change-Id: Ic6e8482dfb022f32532b5c1a6e045092c3485106
2014-03-07coverity#735999 Dereference after null checkCaolán McNamara1-2/+1
Change-Id: Icd48e7051fa9eddedcf66c5589cdbd50ec98b843
2014-03-06coverity#708652 Uninitialized scalar fieldCaolán McNamara1-3/+6
Change-Id: Ideadc6cd30edeb993ca19fd28f97c8665c6bb4a6
2014-03-05Simplify resolution calculationKeith Curtis2-25/+6
Removed unnecessary complexity with resolutions because X in 2014 isn't telling the truth about the size of the screen. My brand-new 13" laptop with the latest X and everything apparently has a 33" x 18" monitor. So if the data isn't reliable, just use 96 dpi anyway which is a very reasonable default. Also got rid of exact resolution member variable. LibreOffice can just always think it has exact resolution. If it doesn't, then it just means the code needs to be smarter, not that we need a flag about whether the data we have is "exact" or not. Change-Id: Ic41bdc3a82dbd1fdb6a987d6dc49adad8194ce14 Reviewed-on: https://gerrit.libreoffice.org/8166 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-03-03Use cstdlib std::abs instead of stdlib.h absStephan Bergmann1-1/+4
...because the latter lacks the abs(long) overload in some popular environments, cf. <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60401> "stdlib.h does not provide abs(long) overload." Similarly, stdlib.h lacks the abs(float), abs(double), abs(long double) overloads compared to cmath there, whose use was apparently intended in sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx. Rewrote that to use CPPUNIT_ASSERT_DOUBLES_EQUAL instead, which revealed that the comparisons need rather large deltas of .1 resp. .2 (which the original code hid with an implicit conversion to integral type, thus using an effective delta of 1). Discovered with -Wabsolute-value ("absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value") recently introduced on Clang trunk towards 3.5. Change-Id: I4c41575ffdccb2944498b662bd3a53fd510cb0c0
2014-03-03KDE4: evaluate frameWidth in the Qt threadJan-Marek Glogowski5-19/+39
When opening a document via Java UNO without a running LO instance, one gets the following Qt error messages: CE> QObject: Cannot create children for a parent that is in a different thread. CE> (Parent is Oxygen::WidgetStateEngine(0x8deb878), parent's thread is QThread(0x8d6cf70), current thread is QThread(0xa8fa7fc8) CE> QObject::installEventFilter(): Cannot filter events for objects in a different thread. CE> QObject::installEventFilter(): Cannot filter events for objects in a different thread. CE> QObject::installEventFilter(): Cannot filter events for objects in a different thread. This happens, because the Java UNO call is processed in the first / Qt thread while document loading happens in a second thread. Document loading actually just calls getNativeControlRegion, which should not involve any drawing. But the KDE4 backend does some style processing to get the correct frame width (QWidget::ensurePolished(), which uses GUI based events and need to be processed in the Qt thread. Change-Id: I344d5089d958963c48a9a8a84bfa9fe8f092b75a
2014-03-03fdo#45935: try hard to paint a frame for menusJan-Marek Glogowski2-8/+21
Current Oxygen theme doesn't draw frames for menus, but uses shaped and "colored" background images. This workaround paints the window and menu frame for menus. Any frame seems to be better then no frame at all. Change-Id: I4d553ea58cac2729826f8395cb2597fa200187b6
2014-03-03KDE4: Report correct check and radio item sizesJan-Marek Glogowski1-3/+17
Use the correct sizs from the current style. Change-Id: I7e163bdc8d467baf2d6e3d0d2bc3e1da7558cf42
2014-03-03KDE4: sleep in yield for native file pickerJan-Marek Glogowski4-5/+28
As it seems to be the only way to poll the clipboard, reintroduce m_pApplication->clipboard()->setProperty( "useEventLoopWhenWaiting", true ); To prevent crashes, disable event processing in the Qt thread while the dialog is open. Instead this applies the same workaround as the Windows backend to sleep a ms, which keeps the FP dialogs more usable, but feels like a horrible workaround. This is still slower then running processEvent in Yield but still much better then the current situation. Change-Id: I10c422f1c0d7448d4a7ad28e57a32ed2cb42f48f
2014-03-03KDE4: Drop Qt 4.9 supportJan-Marek Glogowski1-36/+0
I don't think there will ever be any 4.9 release, so drop all the unused code. Change-Id: I4b72de96e6064240582cd83d4e45547096a2efb0
2014-03-02coverity#735998 Dereference after null checkCaolán McNamara1-1/+1
Change-Id: I882bcb2cdde8697ffb5272fd80e2fd602ed54743
2014-03-01fdo#74064 The filename gets properly highlighted in the Save As dialog.Rachit Gupta1-3/+7
The filename was missing the extension which was causing problems. The extension is retained now by disabling the autoextension checkbox. Change-Id: If913124c22265da2bacb043d83386fd8f5710ca8 Reviewed-on: https://gerrit.libreoffice.org/8364 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-28Rename GetGraphics to AcquireGraphicsChris Sherlock6-7/+7
Currently there are a number of classes that have a function called GetGraphics(). It returns a SalGraphics instance if one is available for the sole use of the caller. Some variants keep a pool of available SalGraphics and return one not currently in use by anyone, creating extra ones on demand, sometimes up to a set limit and returning NULL on reaching that limit of simultaneously in use SalGraphics. This is confusing. What is really happening from the perspective of the calling is that is that we are attempting to *acquire* ownership of a SalGraphics instance. Therefore, rename GetGraphics to AcquireGraphics() which returns a handle to a SalGraphics if we can acquire a free graphics instance, and NULL if we cannot, which makes it cleared that ReleaseGraphics should be called on the result of AcquireGraphics. The classes that were changed to include the new acquire function are: * SalFrame * SalVirtualDevice * SalInfoPrinter * PspSalInfoPrinter * X11SalFrame * X11SalVirtualDevice * GtkSalFrame * KDESalFrame * TDESalFrame * WinSalFrame * WinSalInfoPrinter * WinSalVirtualDevice * SvpSalFrame * SvpSalVirtualDevice * AquaSalFrame * AquaSalInfoPrinter * AquaSalVirtualDevice Change-Id: Ic39c08a4bcaf665ae08ba2808cd03b0e80790c46 Reviewed-on: https://gerrit.libreoffice.org/8070 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-28bool clean-up fixupStephan Bergmann1-3/+2
Change-Id: I0a302d7f91ef07992f95a8ccd48efec862519ab1
2014-02-28WaE: implicit conversion (IntegralCast) from bool to 'int'Tor Lillqvist1-1/+1
Change-Id: I8094180c898c89351caa4805e395c3f3f2b0a946
2014-02-28WaE: implicit conversion (IntegralCast) from bool to 'int'Tor Lillqvist1-1/+2
Hack to avoid false positive from loplugin. Change-Id: I2b25f06299e40ea0cb155a6b748f38e1cb1ffc0d
2014-02-28WaE: implicit conversion (IntegralCast) from bool to 'long'Tor Lillqvist1-3/+3
Change-Id: If0d7ca02e8ecbc15eabc7807a71554ce11d92552
2014-02-28WaE: implicit conversion (IntegralCast) from bool to 'int'Tor Lillqvist1-1/+1
Change-Id: Ifaeeb0f01dbcd0225ee50c15d0b2417f99b1bd0e
2014-02-28sal_Bool -> bool in mostly vcl moduleChris Sherlock20-143/+143
Conflicts: include/vcl/settings.hxx svtools/source/table/tablecontrol_impl.cxx sw/source/core/frmedt/fecopy.cxx vcl/inc/canvasbitmap.hxx vcl/inc/headless/svpframe.hxx vcl/inc/unx/salframe.h vcl/inc/win/salframe.h vcl/inc/win/salprn.h vcl/inc/win/salvd.h vcl/osx/DragSource.cxx vcl/osx/DragSource.hxx vcl/osx/DropTarget.cxx vcl/osx/DropTarget.hxx vcl/osx/OSXTransferable.cxx vcl/osx/OSXTransferable.hxx vcl/osx/clipboard.cxx vcl/osx/clipboard.hxx vcl/osx/salprn.cxx vcl/qa/cppunit/canvasbitmaptest.cxx vcl/source/components/fontident.cxx vcl/source/control/edit.cxx vcl/source/control/spinfld.cxx vcl/source/gdi/gdimtf.cxx vcl/source/gdi/virdev.cxx vcl/source/helper/canvasbitmap.cxx vcl/source/window/dockwin.cxx vcl/unx/generic/dtrans/X11_selection.hxx vcl/unx/kde/UnxFilePicker.cxx vcl/unx/kde/UnxFilePicker.hxx vcl/unx/kde4/KDE4FilePicker.cxx vcl/unx/kde4/KDE4FilePicker.hxx vcl/unx/kde4/KDESalFrame.hxx Change-Id: I9866d985da86dea2a56feff23f91c1467a1636b0 Reviewed-on: https://gerrit.libreoffice.org/8219 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-28debug only code SalDisplay::PrintInfo()Noel Grandin1-1/+1
Change-Id: I9ead37ff69dc7198faae6758a346111ed1d029e3
2014-02-26cppuhelper: retrofit std::exception into overriding exception specsStephan Bergmann22-279/+279
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-26Remove visual noise from vclAlexander Wilms30-168/+168
Conflicts: vcl/source/app/settings.cxx vcl/source/window/dockmgr.cxx vcl/source/window/dockwin.cxx vcl/source/window/floatwin.cxx vcl/source/window/toolbox2.cxx Change-Id: Ie67681549a76e77064b09d4b5bf80fe4c6010341 Reviewed-on: https://gerrit.libreoffice.org/8339 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-25Add config_libraries.h definitions to get library names easily.Matúš Kukan1-10/+8
Works for libmerged too, so we can get rid of LIBO_MERGELIBS. And remove few more #defines in vcl. It's generated by gbuild, so probably abusing config_host directory. Open to improvements. Change-Id: I87ab109bf109e42751766011daf076e9cdf8f5ee
2014-02-23Remove unneccessary commentsAlexander Wilms25-340/+340
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb Reviewed-on: https://gerrit.libreoffice.org/8182 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-21Adapt vcl to various loplugin warnings on Mac OS XStephan Bergmann2-3/+3
Change-Id: I4553ce218fbcf2ac681b284c71e7d558a451511c
2014-02-21other vclplugs need adaptingCaolán McNamara2-2/+2
Change-Id: I83c54b27dc58dfeac72462d8c5eb92a08b5e8e2e
2014-02-21Bug #63962 Dynamically scan the config directory for icon themesTobias Lippert2-2/+2
The hard-coded icon themes have been replaced by a dynamic list which is filled by scanning the config directory Conflicts: include/vcl/settings.hxx vcl/source/app/settings.cxx vcl/source/window/window.cxx Change-Id: Ie3680ffe27d06e375acf22753e036cb6ddabc4ed Reviewed-on: https://gerrit.libreoffice.org/7935 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-21vcl: sal_Bool -> boolStephan Bergmann31-392/+395
Change-Id: I2a3e3d3e3266ea0f0fafdd91362076a4aa160f0e
2014-02-20Remove vcl/settings.hxx from vcl/svapp.hxx and vcl/outdev.hxxTobias Lippert8-1/+12
Added vcl/settings.hxx to all cxx files which require it. This helps to speed up compilation after changes to the settings. Conflicts: sc/source/ui/dbgui/pvlaydlg.cxx Change-Id: I211a0735c47f72d6879f6f15339355abfe0e3cf4 Reviewed-on: https://gerrit.libreoffice.org/7933 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-18fdo#41524: CUPS printing: use "collate" option when PDF is availableMichael Stahl2-0/+20
Assume that the CUPS printer is able to handle collating by itself, don't send multiple print jobs (except if user clicks on "Create single print jobs for collated output" of course...). To enable collating with PDF based printers, add the "collate" option; legacy PS based printers still get the weird stuff read from the PPD (not sure what the risks of changing that are). Change-Id: Ia12dc69f9083bba94f2ed633ecbd153aac7e40ab
2014-02-18vcl: convert some printfs to SAL_INFOMichael Stahl1-68/+31
Change-Id: I0c0ec5242160333a47a4a459c7be5c0a25079f44
2014-02-18coverity#738944 Uninitialized scalar fieldCaolán McNamara1-1/+2
Change-Id: Ic4cc2e8e8b1ff21bc4e1d74cf2fddc0c0d85eafd
2014-02-14fdo#74931 Prevent UpdateSettings from dereferencing null pointerChris Sherlock1-0/+5
When calling on GtkSalFrame::GetGraphics(), if all graphics are in use then it will return NULL. We don't currently check for this, but we still try to use the graphics object even if none are available. I have added a warning when this occurs and just return immediately, as there's nothing more we can do. Change-Id: I24dfbb6f37f41527078a60a7577cb3b20de3fcca Reviewed-on: https://gerrit.libreoffice.org/8031 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-12callcatcher: update unused codeCaolán McNamara1-10/+0
Change-Id: Iaaad9302ef8edb47fa95ce8ca608b6f36449521b
2014-02-10coverity#1027661 Explicit null dereferencedCaolán McNamara1-21/+21
Change-Id: I196bc592e3803a49096a640f2b8da2e1077dcc28
2014-02-07coverity#705773 Resource leakCaolán McNamara1-4/+7
Change-Id: I630fc03502b7bc510313656ae11ae1159f2319ae
2014-02-07Related: fdo#35105 initially map HEADING to ATK_ROLE_HEADINGRadu Ioan1-1/+1
gets overwritten anyway, but its less confusing this way Change-Id: Ib7da2b7787afa7804496337358f0ef6fc7d42b3e Reviewed-on: https://gerrit.libreoffice.org/7834 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2014-02-06fdo#72187 Implement KDE4 picker notificationsJan-Marek Glogowski2-0/+26
This notifies the XFilePickerListener of filter changes and file selection changes. Change-Id: I749c5f7420f020a3a2fbb764acb5c45d40972cf1
2014-02-06Simplify control item switch statementsJan-Marek Glogowski1-177/+86
Just check the dynamic_cast result to verify check boxes. Change-Id: I5f370e337e12719eb7ef0dd3512a0f46c76a981e
2014-02-06Related: rhbz#1061864 filtername is somehow NULLCaolán McNamara1-2/+5
Change-Id: I11930d8401ada43c7fce570131baf2e8a7067ecb