Commit Graph

1063 Commits

Author SHA1 Message Date
Paul Cornett
6674ca57da implement wxDC::GetContentScaleFactor() for GTK3 2016-02-22 09:52:26 -08:00
Paul Cornett
f95fd11e08 Allow drawing HiDPI bitmaps with GTK3
1. Override wxWindow::GetContentScaleFactor() to use gdk_window_get_scale_factor()
   when available, and to use correct scale (1.0) otherwise, as wxDC::GetPPI()
   (used by overridden method) is not properly implemented for wxGTK
2. Record scale in wxBitmap(wxImage&) ctor and wxBitmap::CreateScaled()
3. Adjust cairo scale for drawing bitmap, and (inversely) for drawing on bitmap
2016-02-14 13:12:52 -08:00
Paul Cornett
94163e48c0 avoid gtk_style_context_get_*color(), deprecated in GTK+ 3.16 2016-02-08 10:44:18 -08:00
Paul Cornett
492d8318d6 fix building with GTK+ 2.16 or earlier 2016-02-05 23:08:07 -08:00
Kinaou Herve
8034e35391 Use IsTopNavigationDomain() in accelerator handling code in all ports
This is more correct than IsTopLevel() as accelerators shouldn't traverse the
"navigation domain" boundaries, by definition, and, even more importantly in
practice, some TLWs shouldn't stop the accelerators propagation, see the next
commit.

See #16870.
2016-01-30 18:40:07 +01:00
Vadim Zeitlin
f74379c751 Avoid duplicate wxEVT_UPDATE_UI for popup menus
Don't call wxMenu::UpdateUI() explicitly in wxMSW, wxGTK and wxOSX code before
showing the popup menu as it is also called when any menu is opened from
port-independent wxFrameBase wxEVT_MENU_OPEN handler, resulting in two events
being generated.

But also don't send the events from wxFrameBase handler only to the frame
itself, by explicitly passing "source" argument to wxMenu::UpdateUI(), as this
prevented the event from being sent to the window popping up the menu. By just
omitting this parameter we ensure that this event is sent to the right window.

Closes #17352 (but notice that there are still duplicate events under OS X,
see #17354).
2016-01-30 17:35:42 +01:00
Tim Kosse
8eef0f9ce2 Don't assert if Ctrl+Tab is pressed inside a wxGTK window
Ignore the WinChange flag in DoNavigateIn() to fix an assertion that happened
when pressing Ctrl+Tab with the generic wxListCtrl having focus.

This seems to be consistent with pressing Ctrl+Tab elsewhere, e.g. when
cycling between buttons in a dialog.
2016-01-14 15:50:54 +01:00
Jens Göpfert
abd46cb99a Add support for multimedia keys to wxMSW and wxGTK
Add WXK_XXX constants for the standard multimedia keys and generate events
corresponding to them under wxGTK and wxMSW.

Closes https://github.com/wxWidgets/wxWidgets/pull/157
2016-01-08 23:22:24 +01:00
Paul Cornett
beffb32d2d Avoid invalidating best size for foreground/background color change 2015-10-02 10:11:58 -07:00
Paul Cornett
8bceeba143 Show widget at GTK+ level regardless of "child visibility" status, see #17134, #4343 2015-09-07 09:43:18 -07:00
Paul Cornett
9cfda3ca4d IsShown() now returns false for non-selected wxNotebook pages, see #4343 2015-08-15 11:04:20 -07:00
Paul Cornett
bf6f3e35e8 Fix wxListBox mouse wheel scrolling with GTK3
Allow default handling for GDK_SCROLL_SMOOTH when we don't handle it. Closes #17097
2015-08-09 21:01:48 -07:00
Vadim Zeitlin
2509e7927a Handle GTK_POLICY_EXTERNAL new in GTK+ 3.16 too.
Apparently this still doesn't display any scrollbars in the window itself, so
from our point of view it is equivalent to GTK_POLICY_NEVER.
2015-08-03 17:57:33 +02:00
Paul Cornett
b7cf54d24a Avoid using gdk_window_freeze_updates() to implement Freeze()
Implement Freeze() by blocking the GtkWindow "expose-event"/"draw" signal
instead. Since the introduction of client-side windows in GTK+ 2.18,
gdk_window_freeze_updates() is unuseable because the impl_window (and thus the
update_freeze_count) for a given GdkWindow can change unpredictably. See #16795
2015-06-24 08:43:30 -07:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Paul Cornett
faf3e3d41f Avoid freeze count mismatches with GTK 2.18+ when impl_window changes while frozen, see #16795 2015-04-17 08:46:16 -07:00
Vadim Zeitlin
35f5d0817a Fix coordinates of wxSetCursorEvent in wxGTK.
The event coordinates remained in the client coordinates of the window the
initial event had been sent to, even when the event was propagated to its
parent.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-14 15:05:29 +00:00
Paul Cornett
9bf0ccb2bf More complete fix to avoid GDK assertion "impl_window->update_freeze_count > 0" on Ubuntu.
Any frozen window in the whole TLW could be affected, not just a child of the enabled window.
Also do a more complete search for scrollbars.
Closes #16795


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-12 06:12:16 +00:00
Paul Cornett
0081690355 build fix for __WXUNIVERSAL__
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-11 18:11:07 +00:00
Paul Cornett
78d0393cc0 avoid GDK assertion "impl_window->update_freeze_count > 0" on Ubuntu when enabling frozen window
closes #16795


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-11 18:05:15 +00:00
Paul Cornett
a2207b3c94 don't assume size-allocate implies a widget is realized
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-09 18:19:14 +00:00
Vadim Zeitlin
17135e0a77 Don't use X11-only functions when not using X11 in wxGTK.
See #16688.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-19 13:29:28 +00:00
Paul Cornett
dc555a92e3 notify all windows in capture stack about capture lost, and empty the stack
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78148 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-15 17:02:21 +00:00
Paul Cornett
00cc0233f6 fix releasing mouse capture before showing modal dialog, see #16647
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78147 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-14 18:56:37 +00:00
Paul Cornett
4d40e7806c fix build with old pango versions which don't define PANGO_VERSION_CHECK(), closes #16660
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-11 18:31:21 +00:00
Paul Cornett
807a3091c0 avoid multiple emissions of the GtkAdjustment "changed" signal when configuring scrollbar
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-10 17:10:35 +00:00
Paul Cornett
a16a0e092d invalidate cached client size when scrollbar visibility changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-10 16:51:58 +00:00
Vadim Zeitlin
0c6f5c346d Update mouse capture stack when showing modal dialog in wxGTK.
GTKReleaseMouseAndNotify(), which is called before showing a modal dialog in
wxGTK to ensure that the mouse does not remain captured by the window which
will be disabled by the modal dialog soon, should update the mouse capture
stack and so must call ReleaseMouse() to do it, not just DoReleaseMouse().

See #16647, #8657.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-27 17:31:03 +00:00
Paul Cornett
a776eb65d0 Fix ClientToScreen()/ScreenToClient() when used immediately after window creation.
And whenever window does not have an up-to-date GTK size allocation.
Closes #16061


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-19 00:59:20 +00:00
Vadim Zeitlin
42fdb98f74 Don't prevent the other button release handlers from running in wxGTK.
There doesn't seem to be any advantage in doing this, but it can result in
problems see #16055. So just always let the other handlers for this event
execute as well, even if we did process it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-27 16:12:40 +00:00
Paul Cornett
d0406f4606 Fix handling of identical consecutive key events
Events generated programmatically may have the same timestamp as the previous
event, which caused them to be ignored on the assumption that they were the same
event being sent to a parent window. Fix this by detecting when a new event could
be generated by the event loop.
Closes #15802


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-15 17:09:39 +00:00
Vadim Zeitlin
c29b6dfaf3 Avoid g++ warning about using possibly uninitialized PangoContext.
Initialize it to NULL as it could indeed be left uninitialized in some build
configurations before.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-06-11 14:55:14 +00:00
Vadim Zeitlin
baf28b5fe3 Make wxGetPangoContext() work even without open display.
Use default Pango font map if we don't have any default screen in wxGTK.

Closes #16240.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-07 15:24:50 +00:00
Paul Cornett
a0f10ec1d6 Implement access to a global toplevel GdkWindow in a way that does not require always having an extra GtkWindow.
And don't use "RootWindow" in the name, it is not a root window in the X11 sense.
Also add wxGetPangoContext() to get access to a PangoContext.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-05 15:53:27 +00:00
Paul Cornett
6c6362401c Delay GtkIMContext calls until widget is realized.
This may avoid a locking bug seen on Ubuntu which causes a deadlock.
See #16202


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-26 17:11:31 +00:00
Paul Cornett
5fa3e7866e don't use Cairo functions when wxUSE_CAIRO==0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76353 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-15 17:23:59 +00:00
Paul Cornett
f2e5faeb0a fix invisible multi-line wxTextCtrl selection when custom foreground/background color is used with GTK3
closes #16176


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-10 15:57:28 +00:00
Paul Cornett
79b8852011 fix invisible wxTextCtrl selection when custom foreground/background color is used with GTK3
closes #16176


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-09 04:41:33 +00:00
Paul Cornett
5e6dd2fcb4 build fixes for wxUniversal
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-15 19:34:31 +00:00
Paul Cornett
d2e4b3520b for GTK+ 3.6 and later, invalidate cached best size when GTK's style cache is updated, see #16088
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-15 18:44:02 +00:00
Vadim Zeitlin
2b5574c6ea Make Move{Before,After}InTabOrder() work at any time in wxGTK.
These functions only worked if called at the beginning, before showing the
parent window containing the children whose TAB order was being adjusted,
because it didn't refresh the GTK+ TAB order on the correct window: we need to
do it for the parent of the window being moved, not this window itself.

Closes #16032.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-09 14:05:02 +00:00
Paul Cornett
daf5667de5 fix memory leak in SetFont with GTK3
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76095 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-07 18:43:56 +00:00
Paul Cornett
320a5da559 mimic wxMSW wxSetCursorEvent propagation behavior, closes #15801
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-15 18:14:48 +00:00
Paul Cornett
d35ca1d7aa avoid forcing a paint on a window with zero size, see #15976
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75882 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-13 16:46:57 +00:00
Paul Cornett
8f97969383 add missing GTK3 implementations of GTKGetWindow()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75864 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-09 19:53:17 +00:00
Paul Cornett
1b131bf7e5 emit signal by id instead of name
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-09 18:36:15 +00:00
Paul Cornett
c51c65633b Use "state-flags-changed" signal with GTK3, deprecated "state-changed" is ignored.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75861 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-09 16:49:35 +00:00
Paul Cornett
9d0d2b7e98 Fix wxSetCursorEvent handling
For compatibility with wxMSW, send event up the parent chain.
Properly handle setting the cursor for a wxSetCursorEvent, and don't overwrite the window cursor.
see #15801


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-06 08:54:17 +00:00
Paul Cornett
0dfeb74e78 Different fix for cursor inheritance and busy cursor/global cursor.
Previous work was not compatible with GTK < 2.18 and did not properly handle some cases
see #15801


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75807 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-06 04:43:46 +00:00
Paul Cornett
95695c0a9f don't avoid no-window widgets in GTKUpdateCursor()
it doesn't work for things like multi-line text control where m_widget is a no-window GtkScrolledWindow

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-01 21:01:09 +00:00