add more log info
store last changed font the formerly used panelConvertFont method does not work properly under macOS 26 Tahoe, see #26017
Merge branch 'osx-fontpanel' of github.com:csomor/wxWidgets Fix wxFontPicker under macOS 26. See #26022. Closes #26017.
Use actual timestamps in wxOSX messages to avoid crash with CEF Change the two dummy messages to use systemUpTime as timestamp instead of 0 to fix CEF renderer process crash. Beginning with Chromium 97, EventLatencyTracingRecorder was added to trace the performance. And the timestamp 0 used will lead to a check failure in EventLatencyTracingRecorder::RecordEventLatencyTraceEvent see: https://github.com/chromium/chromium/blob/109.0.5414.120/cc/metrics/event_latency_tracing_recorder.cc Way to reproduce the crash: Right click to popup the context-menu created by CEF. Then the CEF renderer process will crash. Set the timestamp to [[NSProcessInfo processInfo] systemUptime] to fix it. See #24520.
Make wxWebviewWebkit in wxOSX capture hot keys less eagerly On macOS, wxWebviewWebkit eagerly captures the hotkeys despite the fact that it might not be focused which interferes with other windows. It should only handle the hotkeys when it is the firstResponder. See #24520.
Fix wxPopupTransientWindow mouse event handling in wxOSX Using wxFindWindowAtPoint() was wrong as it could find the underlying TLW, just check whether the mouse is inside the popup rectangle directly instead. See #24520. Co-authored-by: Vadim Zeitlin <va...@wxwidgets.org>
Fix wxRibbonButtonBar layout overall size computation Since we already have CalculateOverallSize, avoid duplicating it incorrectly in MakeLayouts(): this could result in an assertion being triggered in TryCollapseLayout. See #24520.
Fix generic wxHeaderCtrl refresh when dragging columns in it Ensure that all columns after the one being resized are refreshed too. See #24520.
Increase click area for +/- buttons in wxGenericTreeCtrl The native control reacts to clicks on the whole area around the expander button, not just the chevron/triangle itself, so mimic this in the generic control too. Enable this behaviour for wxGTK, in addition to wxOSX (it should probably be enabled unconditionally, but wasn't tested in other ports). See #26029.
Correct colour for selected tree control expanders in wxGTK In wxGTK the button on a selected item had the wrong (too dark) colour (basically dark shape on dark selection background). It now matches the native control colour 100% and is better visible. Closes #26029.
| ... | ... | @@ -219,8 +219,10 @@ void FontPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) |
| 219 | 219 | |
| 220 | 220 | void FontPickerWidgetsPage::OnFontChange(wxFontPickerEvent& event)
|
| 221 | 221 | {
|
| 222 | - wxLogMessage("The font changed to '%s' with size %d !",
|
|
| 223 | - event.GetFont().GetFaceName(), event.GetFont().GetPointSize());
|
|
| 222 | + wxLogMessage("The font changed to '%s' with size %d, style %s, weight %d !",
|
|
| 223 | + event.GetFont().GetFaceName(), event.GetFont().GetPointSize(),
|
|
| 224 | + event.GetFont().GetStyle() == wxFONTSTYLE_NORMAL ? "regular" : "italic",
|
|
| 225 | + event.GetFont().GetNumericWeight());
|
|
| 224 | 226 | }
|
| 225 | 227 | |
| 226 | 228 | void FontPickerWidgetsPage::OnCheckBox(wxCommandEvent &event)
|
| ... | ... | @@ -442,19 +442,17 @@ void wxPopupTransientWindow::OnIdle(wxIdleEvent& event) |
| 442 | 442 | |
| 443 | 443 | if (IsShown() && m_child)
|
| 444 | 444 | {
|
| 445 | - // Store the last mouse position to minimize the number of calls to
|
|
| 446 | - // wxFindWindowAtPoint() which are quite expensive.
|
|
| 445 | + // Store the last mouse position to skip redoing the check if nothing
|
|
| 446 | + // has changed.
|
|
| 447 | 447 | static wxPoint s_posLast;
|
| 448 | 448 | const wxPoint pos = wxGetMousePosition();
|
| 449 | 449 | if ( pos != s_posLast )
|
| 450 | 450 | {
|
| 451 | 451 | s_posLast = pos;
|
| 452 | 452 | |
| 453 | - wxWindow* const winUnderMouse = wxFindWindowAtPoint(pos);
|
|
| 454 | - |
|
| 455 | 453 | // We release the mouse capture while the mouse is inside the popup
|
| 456 | 454 | // itself to allow using it normally with the controls inside it.
|
| 457 | - if ( wxGetTopLevelParent(winUnderMouse) == this )
|
|
| 455 | + if ( GetScreenRect().Contains(pos) )
|
|
| 458 | 456 | {
|
| 459 | 457 | if ( m_child->HasCapture() )
|
| 460 | 458 | {
|
| ... | ... | @@ -350,6 +350,7 @@ void wxHeaderCtrl::StartOrContinueResizing(unsigned int col, int xPhysical) |
| 350 | 350 | //else: we had already done the above when we started
|
| 351 | 351 | |
| 352 | 352 | }
|
| 353 | + RefreshColsAfter(col);
|
|
| 353 | 354 | }
|
| 354 | 355 | |
| 355 | 356 | void wxHeaderCtrl::EndResizing(int xPhysical)
|
| ... | ... | @@ -735,11 +735,15 @@ wxGenericTreeItem *wxGenericTreeItem::HitTest(const wxPoint& point, |
| 735 | 735 | flags |= wxTREE_HITTEST_ONITEMLOWERPART;
|
| 736 | 736 | |
| 737 | 737 | int xCross = m_x - theCtrl->FromDIP(theCtrl->GetSpacing());
|
| 738 | -#ifdef __WXMAC__
|
|
| 739 | - // according to the drawing code the triangels are drawn
|
|
| 740 | - // at -4 , -4 from the position up to +10/+10 max
|
|
| 741 | - const int triangleStart = theCtrl->FromDIP(4);
|
|
| 742 | - const int triangleEnd = theCtrl->FromDIP(10);
|
|
| 738 | +#if defined(__WXMAC__) || defined(__WXGTK__)
|
|
| 739 | + // according to the drawing code the triangles are drawn
|
|
| 740 | + // at -4/-4 from the position up to +10/+10 max, but
|
|
| 741 | + // we have to detect the clicks at -10,-10 as also the
|
|
| 742 | + // native controls react to mouse click on the full
|
|
| 743 | + // height of the entry, not just where the triangle or
|
|
| 744 | + // chevron is drawn
|
|
| 745 | + const int triangleStart = theCtrl->FromDIP(10); // -10,-10
|
|
| 746 | + const int triangleEnd = theCtrl->FromDIP(10); // +10, +10
|
|
| 743 | 747 | if ((point.x > xCross - triangleStart) && (point.x < xCross + triangleEnd) &&
|
| 744 | 748 | (point.y > y_mid - triangleStart) && (point.y < y_mid + triangleEnd) &&
|
| 745 | 749 | HasPlus() && theCtrl->HasButtons() )
|
| ... | ... | @@ -2866,6 +2870,8 @@ wxGenericTreeCtrl::PaintLevel(wxGenericTreeItem *item, |
| 2866 | 2870 | flag |= wxCONTROL_EXPANDED;
|
| 2867 | 2871 | if (item == m_underMouse)
|
| 2868 | 2872 | flag |= wxCONTROL_CURRENT;
|
| 2873 | + if (item->IsSelected())
|
|
| 2874 | + flag |= wxCONTROL_SELECTED;
|
|
| 2869 | 2875 | |
| 2870 | 2876 | wxRendererNative::Get().DrawTreeItemButton
|
| 2871 | 2877 | (
|
| ... | ... | @@ -334,6 +334,8 @@ wxRendererGTK::DrawTreeItemButton(wxWindow* WXUNUSED_IN_GTK3(win), |
| 334 | 334 | }
|
| 335 | 335 | if (flags & wxCONTROL_CURRENT)
|
| 336 | 336 | state |= GTK_STATE_FLAG_PRELIGHT;
|
| 337 | + if (flags & wxCONTROL_SELECTED)
|
|
| 338 | + state |= GTK_STATE_FLAG_SELECTED;
|
|
| 337 | 339 | |
| 338 | 340 | int expander_size;
|
| 339 | 341 | gtk_widget_style_get(tree, "expander-size", &expander_size, nullptr);
|
| ... | ... | @@ -45,6 +45,7 @@ |
| 45 | 45 | @public
|
| 46 | 46 | bool m_isUnderline;
|
| 47 | 47 | bool m_isStrikethrough;
|
| 48 | + NSFont* m_currentFont;
|
|
| 48 | 49 | }
|
| 49 | 50 | |
| 50 | 51 | // Delegate methods
|
| ... | ... | @@ -63,6 +64,7 @@ |
| 63 | 64 | {
|
| 64 | 65 | m_isUnderline = false;
|
| 65 | 66 | m_isStrikethrough = false;
|
| 67 | + m_currentFont = nil;
|
|
| 66 | 68 | }
|
| 67 | 69 | return self;
|
| 68 | 70 | }
|
| ... | ... | @@ -94,8 +96,9 @@ |
| 94 | 96 | - (void)changeFont:(id)sender
|
| 95 | 97 | {
|
| 96 | 98 | NSFont *dummyFont = [NSFont userFontOfSize:12.0];
|
| 97 | - [[NSFontPanel sharedFontPanel] setPanelFont:[sender convertFont:dummyFont] isMultiple:NO];
|
|
| 98 | - [[NSFontManager sharedFontManager] setSelectedFont:[sender convertFont:dummyFont] isMultiple:false];
|
|
| 99 | + m_currentFont = [sender convertFont:dummyFont];
|
|
| 100 | + [[NSFontPanel sharedFontPanel] setPanelFont:m_currentFont isMultiple:NO];
|
|
| 101 | + [[NSFontManager sharedFontManager] setSelectedFont:m_currentFont isMultiple:false];
|
|
| 99 | 102 | }
|
| 100 | 103 | @end
|
| 101 | 104 | |
| ... | ... | @@ -238,6 +241,7 @@ int RunMixedFontDialog(wxFontDialog* dialog) |
| 238 | 241 | }
|
| 239 | 242 | theFPDelegate->m_isStrikethrough = font.GetStrikethrough();
|
| 240 | 243 | theFPDelegate->m_isUnderline = font.GetUnderlined();
|
| 244 | + theFPDelegate->m_currentFont = font.OSXGetNSFont();
|
|
| 241 | 245 | |
| 242 | 246 | [[NSFontPanel sharedFontPanel] setPanelFont: font.OSXGetNSFont() isMultiple:NO];
|
| 243 | 247 | [[NSFontManager sharedFontManager] setSelectedFont:font.OSXGetNSFont() isMultiple:false];
|
| ... | ... | @@ -266,7 +270,7 @@ int RunMixedFontDialog(wxFontDialog* dialog) |
| 266 | 270 | // if we don't reenable it, FPShowHideFontPanel does not work
|
| 267 | 271 | [[fontPanel standardWindowButton:NSWindowCloseButton] setEnabled:YES] ;
|
| 268 | 272 | // we must pick the selection before closing, otherwise a native textcontrol interferes
|
| 269 | - NSFont* theFont = [fontPanel panelConvertFont:[NSFont userFontOfSize:0]];
|
|
| 273 | + NSFont* theFont = theFPDelegate->m_currentFont;
|
|
| 270 | 274 | [fontPanel close];
|
| 271 | 275 | |
| 272 | 276 | if ( [accessoryView closedWithOk])
|
| ... | ... | @@ -379,7 +379,7 @@ void wxGUIEventLoop::WakeUp() |
| 379 | 379 | NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
|
| 380 | 380 | location:NSMakePoint(0.0, 0.0)
|
| 381 | 381 | modifierFlags:0
|
| 382 | - timestamp:0
|
|
| 382 | + timestamp:[[NSProcessInfo processInfo] systemUptime]
|
|
| 383 | 383 | windowNumber:0
|
| 384 | 384 | context:nil
|
| 385 | 385 | subtype:0 data1:0 data2:0];
|
| ... | ... | @@ -419,7 +419,7 @@ bool wxApp::CallOnInit() |
| 419 | 419 | NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
|
| 420 | 420 | location:NSMakePoint(0.0, 0.0)
|
| 421 | 421 | modifierFlags:0
|
| 422 | - timestamp:0
|
|
| 422 | + timestamp:[[NSProcessInfo processInfo] systemUptime]
|
|
| 423 | 423 | windowNumber:0
|
| 424 | 424 | context:nil
|
| 425 | 425 | subtype:0 data1:0 data2:0];
|
| ... | ... | @@ -812,6 +812,10 @@ void wxWebViewWebKit::RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) |
| 812 | 812 | |
| 813 | 813 | - (BOOL)performKeyEquivalent:(NSEvent *)event
|
| 814 | 814 | {
|
| 815 | + if (self.window.firstResponder != self)
|
|
| 816 | + {
|
|
| 817 | + return NO;
|
|
| 818 | + }
|
|
| 815 | 819 | if ([event modifierFlags] & NSCommandKeyMask)
|
| 816 | 820 | {
|
| 817 | 821 | switch ([event.characters characterAtIndex:0])
|
| ... | ... | @@ -1054,7 +1054,6 @@ void wxRibbonButtonBar::MakeLayouts() |
| 1054 | 1054 | // small buttons small, stacked vertically
|
| 1055 | 1055 | wxRibbonButtonBarLayout* layout = new wxRibbonButtonBarLayout;
|
| 1056 | 1056 | wxPoint cursor(0, 0);
|
| 1057 | - layout->overall_size.SetHeight(0);
|
|
| 1058 | 1057 | for(btn_i = 0; btn_i < btn_count; ++btn_i)
|
| 1059 | 1058 | {
|
| 1060 | 1059 | wxRibbonButtonBarButtonBase* button = m_buttons.Item(btn_i);
|
| ... | ... | @@ -1090,8 +1089,7 @@ void wxRibbonButtonBar::MakeLayouts() |
| 1090 | 1089 | }
|
| 1091 | 1090 | layout->buttons.push_back(instance);
|
| 1092 | 1091 | }
|
| 1093 | - layout->overall_size.SetHeight(available_height);
|
|
| 1094 | - layout->overall_size.SetWidth(cursor.x + stacked_width);
|
|
| 1092 | + layout->CalculateOverallSize();
|
|
| 1095 | 1093 | m_layouts.Add(layout);
|
| 1096 | 1094 | }
|
| 1097 | 1095 | if(btn_count >= 2)
|
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help