summaryrefslogtreecommitdiff
path: root/vcl/win
AgeCommit message (Collapse)Author
2017-07-13WIN shorten DoYield by using existing functionsJan-Marek Glogowski
This also adds an sal_uLong nCount parameter to ImplSalYieldMutexAcquireWithWait, so it can be called like ImplSalAcquireYieldMutex and actually uses the result from the deferred DoYield. Change-Id: Ie3b466ad03e7ed8c35a62f41c09d09757865364d
2017-07-13WIN just wait for the Yield mutex in the timeroutJan-Marek Glogowski
Don't re-schedule a timeout, simply wait in the timer callback. Change-Id: Ib46eb6dbf57f29c85ffdbd6492922020f7785d30
2017-07-13WIN simplify system timer / LO event handlingJan-Marek Glogowski
This removes a level of indirection for the timer callback handling. It also ensures we just have a single timeout message queued. Also drops the 16bit MAX duration limit, as CreateTimerQueueTimer uses a DWORD for the DueTime parameter, which is always UINT32. CreateTimerQueueTimer already sets the period to 0, which makes it a one-shot timer, but there is also the WT_EXECUTEONLYONCE, which enforces the Period parameter to be 0. Change-Id: I549142394334bdc098f053b42f222b23cf4fcecd
2017-07-13WIN unify deferred message handlingJan-Marek Glogowski
Moves the common code into ProcessOrDeferMessage. All callers (try to) aquire the mutex before getting the WinSalFrame pointer, except for ImplHandleDeferredPaintMsg. This was probably an oversight, so this reverses the order in this function, so the GetWindowPtr is now always protected by the Solar mutex. Change-Id: Icb8f34f7e8716f0faa90a95903b1681f7489aed2
2017-07-13WIN cleanup paint message handlingJan-Marek Glogowski
Makes PAINT handling function use the POSTPAINT handling function and unifies the locking behaviour, so we now check the frame before trying to aquire the lock in both functions. Change-Id: Ia6bac6e24d95e680830c5405f0ab34cbed6e9688
2017-07-13Drop special idle handlingJan-Marek Glogowski
Idles are just instant timers, which should most time have a low priority, By dropping most special idle handling we'll just schedule by priority. This also reverts SalYieldResult back to a bool, which just indicates if any event was processed. Change-Id: Ia0b91b06dffb77af066f01838d8f9483523bf67d
2017-07-13Refactor Scheduler global dataJan-Marek Glogowski
Move all Scheduler members of ImplSVData into ImplSchedulerContext and make ImplSchedulerContext a member of ImplSVData. Change-Id: I186bebdfb5701543595848968235b5a56b6598e9
2017-07-13Add some Scheduler unit tests and loggingJan-Marek Glogowski
1. calling Start() for invoked tasks 2. correctly schedule by priority 3. self-stopping AutoTimer This also adds SAL_INFO output to Scheduler and Task to log the scheduling processing tasks. Change-Id: I3c8a708d1fd51c550320f8af3f9486c43c32e358
2017-07-12fix crash when aInkBoxes might be emptyMarkus Mohrhard
e.g. http://crashreport.libreoffice.org/stats/signature/WinFontInstance::CacheGlyphToAtlas(bool,HDC__%20*,HFONT__%20*,int,SalGraphics%20&) Change-Id: I0f32b549c687c2da6534f59a13ce1c5d57047829 Reviewed-on: https://gerrit.libreoffice.org/39874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-07-06tdf#106990 set cleartype setting / force to use GDI render modeTomaž Vajngerl
With this we read the system setting for cleartype and set it to the render target we are using. Additionally we set the GDI like rendering mode which forces that the text is rendered similar as this was done with GDI. Change-Id: If6fb72bc371accf50278c968c94e625aee3f0953 Reviewed-on: https://gerrit.libreoffice.org/39602 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2017-07-05loplugin:casttovoid (clang-cl): vclStephan Bergmann
Change-Id: I4c54f7edc0422382e1cd7fca95c2e7ab2b4bab1c
2017-07-03loplugin:oncevar (clang-cl): vclStephan Bergmann
Change-Id: I0459978c2cfb61cd7251f0e8d9a30f1f19c02c11
2017-06-17loplugin:unusedfields in vcl part3Noel Grandin
Change-Id: I5a6319ba1667af6e9b7b92c22f858188c28c4c61 Reviewed-on: https://gerrit.libreoffice.org/38835 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-30vcl: replace dynamic lookups of Windows 7 APIs with static callsMichael Stahl
Change-Id: I5d4c4bb98e271e69c45b8e7f989f9b21d287c0bb
2017-05-18Clean up a set of RTL-related commentsTor Lillqvist
It is fairly pointless to have a comment like "--- RTL --- (mirror mouse pos)" in front of code that obviously is related to RTL anyway, like "if( AllSettings::GetLayoutRTL() )". Also, the fact that many comment were exactly the same indicates that they has been added as an in-line version control change marker. In other places, comments were informational, but no need for them to include yet another metasyntax, "--- RTL ---". Just "RTL:" works fine. Change-Id: I20feef308ed8ac9d32a8bf440fc20b442753c4ff
2017-05-09remove unnecessary empty OUString fields and varsNoel Grandin
Change-Id: I940120087a0bc6b1b0abc30a3e7727ce22b7d9a7 Reviewed-on: https://gerrit.libreoffice.org/37394 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-08cleanup tools/debug.hxx includesJochen Nitschke
with command > git grep -l tools/debug.hxx | xargs grep -L DBG_ | xargs sed -i '/#include *\(<\|\"\)tools\/debug.hxx.*/d' don't change files in includes/ and */pch Change-Id: Ie429d6a7dca5dfa1073e0f5ba037f7c84bdbec08 Reviewed-on: https://gerrit.libreoffice.org/37349 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-08hNonAliasedFont is unusedNoel Grandin
ever since commit e45d80f20ff6a05888f92ae942abed67609d5b20 Author: Tim Eves <tim_eves@sil.org> Date: Tue Feb 23 16:45:21 2016 +0000 "tdf#97171: Use DirectWrite for OpenGL glyph caching" Change-Id: Ib6675e89caa68a5ee725a36a0d5ded973cc98723 Reviewed-on: https://gerrit.libreoffice.org/37348 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-07tdf#106265 ScopedHDC to clean-up hDC when rendering glyphsTomaž Vajngerl
Change-Id: I96ecf625126740610200c012c3c7002fac7e1548 Reviewed-on: https://gerrit.libreoffice.org/37347 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2017-05-05tdf#103158 ctrl+shift should work on key upMaxim Monastirsky
Under gtk/gtk3 we send CommandEventId::ModKeyChange on key down, to support the auto-accelerator feature. But at least the handler in SwEditWin::Command must get it on key up, in order to not interfere with other ctrl+shift+X shortcuts, which work on key down. To achieve that, we need: - On key up pass the key that was just released, instead of the current state of nothing being pressed. - Have a flag of whether it's a key down or up event, so it can be checked by the application code. Change-Id: If188d6ccdc3b214a2c3ed20aad291d74d46b358f Reviewed-on: https://gerrit.libreoffice.org/37275 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2017-05-04Replace all OUString("") with OUString()Arnaud Versini
Change-Id: Ie14c4d76cb61cfbe0410103adfc1afc8ade0f3e0 Reviewed-on: https://gerrit.libreoffice.org/37146 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-26use strong_int for LanguageTypeNoel Grandin
Change-Id: If99a944f7032180355da291ad283b4cfcea4f448 Reviewed-on: https://gerrit.libreoffice.org/36629 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-25loplugin:checkunusedparams in vclNoel Grandin
Change-Id: I26661684e634aa15a18f78442de15c9db832f319 Reviewed-on: https://gerrit.libreoffice.org/36886 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-24tdf#107205 vcl: don't always use D2DWriteTextOutRendererMichael Stahl
... because it cannot rotate text. (regression from commit df556aa47da22f96b3fcd356c12419d3035cba3c) Change-Id: If9bc6e98b8979c5eb02f1a5cfc12b4d19bdc481b
2017-04-22Don't keep gGlobalGlyphCache, gTextureCache around until exitStephan Bergmann
Those static variables had been introduced with 56c5a0ba7781a325123852737970fa7f0179ff7f "tdf#94682 limit the number of textures for the glyph texture atlas" and dea885f80a80c6a5839ee5dbf8521487186a9522 "opengl: cache native widget textures also for Windows", but at least the clang-cl build crashed on exit from soffice.bin with > Exception thrown at 0x00007FFF3906AA84 (opengl32.dll) in soffice.bin: 0xC0000005: Access violation reading location 0x0000000000000898. > opengl32.dll!glGetString() Unknown > epoxy.dll!epoxy_glGetString_dispatch_table_rewrite_ptr(unsigned int name) Line 46456 C > epoxy.dll!epoxy_glGetString_dispatch_table_thunk(unsigned int name) Line 46456 C > epoxy.dll!epoxy_is_desktop_gl() Line 299 C > epoxy.dll!gl_provider_resolver(const char * name, const gl_provider * providers, const unsigned short * entrypoints) Line 7323 C > epoxy.dll!epoxy_glDeleteTextures_resolver() Line 14646 C > epoxy.dll!epoxy_glDeleteTextures_dispatch_table_rewrite_ptr(int n, const unsigned int * textures) Line 45813 C > epoxy.dll!epoxy_glDeleteTextures_dispatch_table_thunk(int n, const unsigned int * textures) Line 45813 C > vcllo.dll!TextureState::unbindAndDelete(unsigned int nTexture) Line 59 C++ > vcllo.dll!ImplOpenGLTexture::~ImplOpenGLTexture() Line 182 C++ > [External Code] > vcllo.dll!PackedTextureAtlasManager::~PackedTextureAtlasManager() Line 129 C++ > vcllo.dll!GlobalGlyphCache::~GlobalGlyphCache() Line 67 C++ > [External Code] > vcllo.dll!??__FgGlobalGlyphCache@GlyphCache@@0V?$unique_ptr@UGlobalGlyphCache@@U?$default_delete@UGlobalGlyphCache@@@std@@@std@@A@YAXXZ() Line 48 C++ > [External Code] resp. > Exception thrown at 0x00007FFF3A5AAA84 (opengl32.dll) in soffice.bin: 0xC0000005: Access violation reading location 0x0000000000000898. > opengl32.dll!glGetString() Unknown > epoxy.dll!epoxy_glGetString_dispatch_table_rewrite_ptr(unsigned int name) Line 46456 C > epoxy.dll!epoxy_glGetString_dispatch_table_thunk(unsigned int name) Line 46456 C > epoxy.dll!epoxy_is_desktop_gl() Line 299 C > epoxy.dll!gl_provider_resolver(const char * name, const gl_provider * providers, const unsigned short * entrypoints) Line 7323 C > epoxy.dll!epoxy_glDeleteTextures_resolver() Line 14646 C > epoxy.dll!epoxy_glDeleteTextures_dispatch_table_rewrite_ptr(int n, const unsigned int * textures) Line 45813 C > epoxy.dll!epoxy_glDeleteTextures_dispatch_table_thunk(int n, const unsigned int * textures) Line 45813 C > vcllo.dll!TextureState::unbindAndDelete(unsigned int nTexture) Line 59 C++ > vcllo.dll!ImplOpenGLTexture::~ImplOpenGLTexture() Line 182 C++ > [External Code] > vcllo.dll!OpenGLTexture::~OpenGLTexture() Line 313 C++ > [External Code] > vcllo.dll!TextureCombo::~TextureCombo() Line 51 C++ > [External Code] > vcllo.dll!std::pair<ControlCacheKey, std::unique_ptr<TextureCombo, std::default_delete<TextureCombo> > >::~pair() Line 145 C++ > [External Code] > vcllo.dll!o3tl::lru_map<ControlCacheKey, std::unique_ptr<TextureCombo, std::default_delete<TextureCombo> >, ControlCacheHashFunction>::~lru_map() Line 34 C++ > vcllo.dll!??__FgTextureCache@?A@@YAXXZ() Line 738 C++ > [External Code] Change-Id: I0198f657f5d59314c5f662c214504ed3e1523567 Reviewed-on: https://gerrit.libreoffice.org/36801 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-19loplugin:subtlezeroinit (clang-cl)Stephan Bergmann
Change-Id: I9c8e00be8823f8f2cbf1368b33e2f18b3a386a88
2017-04-14remove the remaining unused mouse cursorsCaolán McNamara
which are not used by us directly or aliases of published awt constants Change-Id: Ic4f009715d71a2f986b8ef8d64b4b2e64986bf3b
2017-04-14revert removal of apparently unused mouse cursorsCaolán McNamara
partial revert of... commit 65b7b6322b662785bf032e66c76abc36c9a2bb0e Date: Wed Feb 8 10:40:28 2017 +0200 loplugin:unusedenumconstants read-only constants in vcl because we cast the com::sun::star::awt::SystemPointer values to PointerStyle in VCLXPointer::setType and we've at least lost the PEN as used in the slideshow context menu's pen mode "toolkit/source/awt/vclxpointer.cxx" 74L, 2181C Change-Id: I5ef677f70ebc491b50403de0f92179ea4ae3bb14 Reviewed-on: https://gerrit.libreoffice.org/36526 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-13tdf#106933 vcl: delete D2DWriteTextOutRenderer before exit()Michael Stahl
As it happens this DirectWrite stuff is using some thread pool internally, and that must be shutdown before exit(), as Win32 will terminate all other threads at that point, and then the thread pool wants to talk to threads that don't exist any more. https://blogs.msdn.microsoft.com/oldnewthing/20120427-00/?p=7763/ So convert this from a global variable that is deleted from DllMain() to a member of SalData, so it is deleted from DeInitVCL(). Change-Id: I51408a07c78758cf0c193ab66b9214d0c9dbd9e3
2017-04-12no need to use OUStringToOString in SAL_INFONoel Grandin
Change-Id: I707e0d72aba89b7e644def6f4c251e14f6599ad2 Reviewed-on: https://gerrit.libreoffice.org/36451 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-07tdf#39468 Translate German commentsJens Carl
Translate German comments and terms in dbaccess/, extensions/, formula/, include/, reportdesign/, rsc/, sd/, svtools/, and vcl/ Change-Id: Ie20dadda0eeb0786eb328c6c652287d5481c5e3b Reviewed-on: https://gerrit.libreoffice.org/36249 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-04-07vcl: remove no longer needed WIN_Rectangle()Miklos Vajna
Not needed anymore after commit a5a571307fb3306b74ab46b085cde6388270a770 (tdf#82580 tools: rename Rectangle to tools::Rectangle, 2017-03-30). Change-Id: I25a11ca0b6c2e9e96847bd01b5e82835d1dd4a95
2017-04-06tdf#106960: Fix math scaling on WindowsKhaled Hosny
Remove this leftoever code from 1b7e788eb3bf9cbe56ed5cc4a3fa7fa5e70ac40a which does nothing useful now. Change-Id: Ia7fa888d5687c9da110b44139a8217558a7f641b Reviewed-on: https://gerrit.libreoffice.org/36222 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-04-04Finally switch MSVC to sal_Unicode = char16_t, tooStephan Bergmann
There is lots of (Windows-only) code that relied on sal_Unicode being the same as wchar_t, and the best change may be different in each case (and doing the changes may be somewhat error prone). So for now add SAL_U/SAL_W scaffolding functions to sal/types.h, remove their uses one by one again, and finally drop those functions again. Change-Id: I2cc791bd941d089901abb5f6fc2f05fbc49e65ea Reviewed-on: https://gerrit.libreoffice.org/36077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-04loplugin:redundantcast (clang-cl)Stephan Bergmann
Change-Id: Ie096d75c1bc774e77c589845f61276d1478234ef Reviewed-on: https://gerrit.libreoffice.org/36065 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-04loplugin:loopvartoosmall (clang-cl)Stephan Bergmann
Change-Id: Ibdfdc5c66cf1e81d9e43c94df31120c476a78572 Reviewed-on: https://gerrit.libreoffice.org/36064 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-04loplugin:redundantinline (clang-cl)Stephan Bergmann
Change-Id: I03a19b599005f6ef25040889a1e1802445ebf430 Reviewed-on: https://gerrit.libreoffice.org/36063 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-28ofz#954 out of memoryCaolán McNamara
Change-Id: Ib27f2dfe0d0837544910208f38a1bc11a35e3cb4 Reviewed-on: https://gerrit.libreoffice.org/35794 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-25Fix typosAndrea Gelmini
Change-Id: I623135cd4c76dd6569f4ee521f97dee41de4cb1e Reviewed-on: https://gerrit.libreoffice.org/35660 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-14loplugin:subtlezeroinit (clang-cl)Stephan Bergmann
Change-Id: I34367cad2d07b9fc6c8f4607ee5e74625f12e78f
2017-03-13WaE: Operator precedence is difficult to get rightTor Lillqvist
Fix C4806: '&': unsafe operation: no value of type 'bool' promoted to type 'int' can equal the given constant Change-Id: Iedd54379a67373fb3499a0a780f2cbfc83f08e84
2017-03-13Bin leftover debugging fprintf with reference to some mysterious 'grLog()'Tor Lillqvist
Change-Id: I6b9423db247583ff1dcbd469db5dfab7f89e7457
2017-03-08CIA: unnecessary dllCaolán McNamara
Change-Id: Icbc3eaff000d90885cf85d8195868e1248493896 Reviewed-on: https://gerrit.libreoffice.org/34972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-06Restore "pPos and pGetNextGlypInfo always have the same value"Caolán McNamara
and... "pEraseRect is always null" This reverts commit b398dacbb471913e573e9b0b4cd31d94a9109223. Change-Id: I5e7c07eefff0b6bd39d9ed7492134ea062e90fdf Reviewed-on: https://gerrit.libreoffice.org/34907 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-03-05Revert "pPos and pGetNextGlypInfo always have the same value"Caolán McNamara
This reverts commit 7453cb58df4ce434a1252567f961cfe497064aca. and... Revert "pEraseRect is always null" I suspect the problem is the change to D2DWriteTextOutRenderer::operator in 7453cb58df4ce434a1252567f961cfe497064aca aborts during windows tinderboxes CppunitTest_dbaccess_empty_stdlib_save etc This reverts commit 073d920ef5914b5dfe491dbaf7fb18ba56293b85. Change-Id: I372e104bd09e49bcf08306169db9777f2f26fff5
2017-03-04pPos and pGetNextGlypInfo always have the same valueKhaled Hosny
Change-Id: Iec46e0aefff71cbeb2face4f55e5c3a4d6698995
2017-03-04pEraseRect is always nullKhaled Hosny
Simplify the code accordingly and make it return true for success. Change-Id: I661eea739e23b59ebff2573f52036b25ecb5a1ed
2017-03-04SalLayout::GetBoundRect() works just fine hereKhaled Hosny
Change-Id: Idce9a8f374f62bd92756d7391ccca3122c89683e