dbaccess/uiconfig/ui/indexdesigndialog.ui | 143 ++++++++++++++---------------- include/vcl/weld/Dialog.hxx | 2 vcl/source/weld/Dialog.cxx | 19 +-- vcl/unx/gtk3/gtkinst.cxx | 10 +- 4 files changed, 87 insertions(+), 87 deletions(-)
New commits: commit 6a237a85ce00faadf0757567f6931ae930fefa6f Author: Michael Weghorn <[email protected]> AuthorDate: Fri Feb 13 14:32:32 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Feb 14 00:50:06 2026 +0100 dbaccess: Resave indexdesigndialog.ui with glade 3.40 Resave with glade 3.40, but manually undo automatic insertion of some <property name="can-focus">False</property> for GtkToolButton objects, to avoid potential side-effects. The dialog can be triggered like this: * start Base * with "Tables" selected on the left, select "Create Table in Design View..." * add 2 fields * save * "Tools" -> "Index Design..." Change-Id: I5eb1aea53261ea2727ccd617fe086e947242bc3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199351 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/dbaccess/uiconfig/ui/indexdesigndialog.ui b/dbaccess/uiconfig/ui/indexdesigndialog.ui index 1d896a74a429..3df0642b6848 100644 --- a/dbaccess/uiconfig/ui/indexdesigndialog.ui +++ b/dbaccess/uiconfig/ui/indexdesigndialog.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> +<!-- Generated with glade 3.40.0 --> <interface domain="dba"> <requires lib="gtk+" version="3.24"/> <object class="GtkTreeStore" id="liststore1"> @@ -13,29 +13,26 @@ </columns> </object> <object class="GtkDialog" id="IndexDesignDialog"> - <property name="can_focus">False</property> - <property name="border_width">6</property> + <property name="can-focus">False</property> + <property name="border-width">6</property> <property name="title" translatable="yes" context="indexdesigndialog|IndexDesignDialog">Indexes</property> <property name="resizable">False</property> - <property name="type_hint">dialog</property> - <child> - <placeholder/> - </child> + <property name="type-hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">2</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> + <property name="can-focus">False</property> + <property name="layout-style">end</property> <child> <object class="GtkButton" id="close"> <property name="label" translatable="yes" context="stock">_Close</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -48,8 +45,8 @@ <object class="GtkButton" id="help"> <property name="label" translatable="yes" context="stock">_Help</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -63,32 +60,32 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="pack_type">end</property> + <property name="pack-type">end</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkBox" id="box1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">6</property> <child> <!-- n-columns=1 n-rows=1 --> <object class="GtkGrid" id="grid3"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <child> <object class="GtkToolbar" id="ACTIONS"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <child> <object class="GtkToolButton" id="ID_INDEX_NEW"> <property name="visible">True</property> <property name="valign">start</property> <property name="label" translatable="yes" context="indexdesigndialog|ID_INDEX_NEW">New Index</property> - <property name="use_underline">True</property> - <property name="icon_name">dbaccess/res/sc036.png</property> + <property name="use-underline">True</property> + <property name="icon-name">dbaccess/res/sc036.png</property> </object> <packing> <property name="expand">False</property> @@ -100,8 +97,8 @@ <property name="visible">True</property> <property name="valign">start</property> <property name="label" translatable="yes" context="indexdesigndialog|ID_INDEX_DROP">Delete Current Index</property> - <property name="use_underline">True</property> - <property name="icon_name">dbaccess/res/sc037.png</property> + <property name="use-underline">True</property> + <property name="icon-name">dbaccess/res/sc037.png</property> </object> <packing> <property name="expand">False</property> @@ -113,8 +110,8 @@ <property name="visible">True</property> <property name="valign">start</property> <property name="label" translatable="yes" context="indexdesigndialog|ID_INDEX_RENAME">Rename Current Index</property> - <property name="use_underline">True</property> - <property name="icon_name">dbaccess/res/sc038.png</property> + <property name="use-underline">True</property> + <property name="icon-name">dbaccess/res/sc038.png</property> </object> <packing> <property name="expand">False</property> @@ -126,8 +123,8 @@ <property name="visible">True</property> <property name="valign">start</property> <property name="label" translatable="yes" context="indexdesigndialog|ID_INDEX_SAVE">Save Current Index</property> - <property name="use_underline">True</property> - <property name="icon_name">dbaccess/res/sc039.png</property> + <property name="use-underline">True</property> + <property name="icon-name">dbaccess/res/sc039.png</property> </object> <packing> <property name="expand">False</property> @@ -139,8 +136,8 @@ <property name="visible">True</property> <property name="valign">start</property> <property name="label" translatable="yes" context="indexdesigndialog|ID_INDEX_RESET">Reset Current Index</property> - <property name="use_underline">True</property> - <property name="icon_name">dbaccess/res/sc040.png</property> + <property name="use-underline">True</property> + <property name="icon-name">dbaccess/res/sc040.png</property> </object> <packing> <property name="expand">False</property> @@ -149,8 +146,8 @@ </child> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> </object> @@ -161,31 +158,31 @@ </packing> </child> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=2 n-rows=1 --> <object class="GtkGrid" id="grid1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> + <property name="can-focus">False</property> + <property name="row-spacing">6</property> + <property name="column-spacing">12</property> <child> <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="shadow_type">in</property> + <property name="shadow-type">in</property> <child> <object class="GtkTreeView" id="INDEX_LIST"> - <property name="width_request">-1</property> + <property name="width-request">-1</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="model">liststore1</property> - <property name="headers_visible">False</property> - <property name="search_column">1</property> - <property name="enable_tree_lines">True</property> + <property name="headers-visible">False</property> + <property name="search-column">1</property> + <property name="enable-tree-lines">True</property> <child internal-child="selection"> <object class="GtkTreeSelection" id="Macro Library List-selection1"/> </child> @@ -212,91 +209,91 @@ </child> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkFrame" id="frame1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=2 n-rows=4 --> <object class="GtkGrid" id="grid5"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> + <property name="can-focus">False</property> <property name="margin-start">12</property> <property name="margin-top">6</property> + <property name="row-spacing">6</property> + <property name="column-spacing">12</property> <child> <object class="GtkLabel" id="DESC_LABEL"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="halign">start</property> <property name="label" translatable="yes" context="indexdesigndialog|DESC_LABEL">Index identifier:</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkLabel" id="DESCRIPTION"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="halign">start</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="left-attach">1</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkCheckButton" id="UNIQUE"> <property name="label" translatable="yes" context="indexdesigndialog|UNIQUE">_Unique</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="left-attach">0</property> + <property name="top-attach">1</property> <property name="width">2</property> </packing> </child> <child> <object class="GtkLabel" id="FIELDS_LABEL"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="halign">start</property> <property name="label" translatable="yes" context="indexdesigndialog|FIELDS_LABEL">Fields:</property> - <property name="use_underline">True</property> + <property name="use-underline">True</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="left-attach">0</property> + <property name="top-attach">2</property> <property name="width">2</property> </packing> </child> <child> <object class="GtkBox" id="FIELDS"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">3</property> + <property name="left-attach">0</property> + <property name="top-attach">3</property> <property name="width">2</property> </packing> </child> @@ -305,7 +302,7 @@ <child type="label"> <object class="GtkLabel" id="INDEX_DETAILS"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="indexdesigndialog|INDEX_DETAILS">Index Details</property> <attributes> <attribute name="weight" value="bold"/> @@ -314,8 +311,8 @@ </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="left-attach">1</property> + <property name="top-attach">0</property> </packing> </child> </object> commit dda0b1fe27ed9069d54eb84029f7df603943e2a1 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Feb 13 14:03:04 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Feb 14 00:49:59 2026 +0100 gtk4 weld: Return actual dialog size in GtkInstanceDialog::get_size If the dialog is visible, use gtk_widget_get_width and gtk_widget_get_height to retrieve the actual size of the dialog for the gtk4 case and only fall back to using gtk_window_get_default_size otherwise. As the documentation of the latter [1] says: > A value of 0 for the width or height indicates that a default size has > not been explicitly set for that dimension, so the “natural” size of the > window will be used. The new implementation should be in line with the gtk3 implementation that uses gtk_window_get_size [2]: > Obtains the current size of window. > > If window is not visible on screen, this function return the size GTK+ > will suggest to the window manager for the initial > window size (but this is not reliably the same as the size the window > manager will actually select). See: > gtk_window_set_default_size(). Returning a 0 size was e.g. triggering the assert when trying to use the screenshot annotation dialog, as described in Change-Id: Ia23a95591319d7cdc8d9e27a4025603644b36f04 Author: Michael Weghorn <[email protected]> Date: Fri Feb 13 13:17:06 2026 +0100 tdf#130857 weld: Implement screenshot menu logic in weld::Dialog base : > The menu/dialog were tested fine for all of gen, gtk3 and qt6 > (with SAL_VCL_QT_USE_WELDED_WIDGETS=1) for > the "Help" -> "About LibreOfficeDev" dialog > according to the desecription at [1]: > > > To create dialog screenshots from running LibreOffice, you need to > > activate screenshotting mode (akin to experimental mode) in Tools ▸ > > Options ▸ Advanced ▸ Open Expert Configuration, the relevant > > configuration key is org.openoffice.Office.Common.Misc.ScreenshotMode. > > Once screenshotting mode is active, right mouse click into any dialog > > action area (where "OK", "Cancel" etc. buttons are) will make a context > > menu appear: > > > > Click Screenshot item of the context menu to create screenshot of the > > current dialog. > > For gtk4, the menu now shows up as expected, but > activating the "Screenshot" menu entry currently > triggers an assert: > > soffice.bin: cui/source/dialogs/screenshotannotationdlg.cxx:266: ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl(weld::Window *, weld::Builder &, weld::Dialog &): Assertion `!maParentDialogBitmap.IsEmpty()' failed. > > The underlying issue is preexisting and will be > addressed in a separate upcoming commit. This commit fixes the underlying issue mentioned above and makes the dialog show up as expected when using gtk4 as well. [1] https://docs.gtk.org/gtk4/method.Window.get_default_size.html [2] https://docs.gtk.org/gtk3/method.Window.get_size.html Change-Id: I50d773a2d132f926608a26383a122118f8f4ccc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199348 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index df6e58d83fd4..f74bb7e1d8b4 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -6480,7 +6480,15 @@ public: #if !GTK_CHECK_VERSION(4, 0, 0) gtk_window_get_size(m_pWindow, ¤t_width, ¤t_height); #else - gtk_window_get_default_size(m_pWindow, ¤t_width, ¤t_height); + if (gtk_widget_is_visible(GTK_WIDGET(m_pWindow))) + { + current_width = gtk_widget_get_width(GTK_WIDGET(m_pWindow)); + current_height = gtk_widget_get_height(GTK_WIDGET(m_pWindow)); + } + else + { + gtk_window_get_default_size(m_pWindow, ¤t_width, ¤t_height); + } #endif return Size(current_width, current_height); } commit 4d356411c07a57c96e3ba021d4798c0d79480245 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Feb 13 13:48:59 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Feb 14 00:49:51 2026 +0100 weld: Merge Dialog::executeScreenshotAnnotationDialog into only caller Now after Change-Id: Ia23a95591319d7cdc8d9e27a4025603644b36f04 Author: Michael Weghorn <[email protected]> Date: Fri Feb 13 13:17:06 2026 +0100 tdf#130857 weld: Implement screenshot menu logic in weld::Dialog base consolidated the different implementations calling that method into one, the method is only called from Dialog::signal_command. Move the logic directly into that method. Change-Id: I6cb21fd531ebbc042a101b7b8867848c52c705c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199347 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/weld/Dialog.hxx b/include/vcl/weld/Dialog.hxx index ebda6651d9b9..3a7bf4fb041e 100644 --- a/include/vcl/weld/Dialog.hxx +++ b/include/vcl/weld/Dialog.hxx @@ -27,8 +27,6 @@ private: protected: virtual bool signal_command(const CommandEvent& rCEvt); - void executeScreenshotAnnotationDialog(); - public: virtual void set_modal(bool bModal) = 0; virtual bool get_modal() const = 0; diff --git a/vcl/source/weld/Dialog.cxx b/vcl/source/weld/Dialog.cxx index a0514d9ac337..2fcf411e8917 100644 --- a/vcl/source/weld/Dialog.cxx +++ b/vcl/source/weld/Dialog.cxx @@ -25,6 +25,7 @@ bool Dialog::signal_command(const CommandEvent& rCEvt) if (CommandEventId::ContextMenu == rCEvt.GetCommand() && officecfg::Office::Common::Misc::ScreenshotMode::get()) { + // show menu to allow opening the screenshot annotation dialog std::unique_ptr<weld::Builder> xBuilder( Application::CreateBuilder(this, u"vcl/ui/screenshotmenu.ui"_ustr)); std::unique_ptr<weld::Menu> pMenu = xBuilder->weld_menu(u"menu"_ustr); @@ -37,7 +38,13 @@ bool Dialog::signal_command(const CommandEvent& rCEvt) if (pMenu->popup_at_rect(this, tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1, 1))) == sMenuItemId) - executeScreenshotAnnotationDialog(); + { + VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create(); + ScopedVclPtr<AbstractScreenshotAnnotationDlg> pDialog + = pFact->CreateScreenshotAnnotationDlg(*this); + assert(pDialog); + pDialog->Execute(); + } return true; } @@ -45,16 +52,6 @@ bool Dialog::signal_command(const CommandEvent& rCEvt) return Window::signal_command(rCEvt); } -void Dialog::executeScreenshotAnnotationDialog() -{ - // open screenshot annotation dialog - VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractScreenshotAnnotationDlg> pDialog - = pFact->CreateScreenshotAnnotationDlg(*this); - assert(pDialog); - pDialog->Execute(); -} - void Dialog::set_default_response(int nResponse) { std::unique_ptr<weld::Button> pButton = weld_button_for_response(nResponse);
