diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-07-29 18:08:21 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-10-02 10:59:49 +0530 |
commit | 0f78547e2f03868128dcc1400c326644dd6438cc (patch) | |
tree | 9a1063d65cb30b9a90bdf6b12698369830059331 /libreofficekit | |
parent | 9f6bf0c0b81039760a00b3be7a80590cf2914206 (diff) |
lokdialog: Trigger repaint on all opened dialog with invalidate
For now, temporarily trigger paints for all the opened
dialogs whenever a dialog invalidation callback is emitted. This solves
the problem for some of the dialogs where hard coded uno command, which
we are using as dialog IDs in GTV, doesn't match with the dialog id
contained in the payload of the invalidation callback.
With this SearchDialog, AcceptChangeTracking and few others are
responding well to mouse clicks and invalidate instantaneously while to
invalidate and repaint some other dialogs, one needs to refocus them.
Change-Id: Iac2acbda60c8e2d0eabe65440f3fbda3ef271d7a
Diffstat (limited to 'libreofficekit')
4 files changed, 26 insertions, 3 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx b/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx index ab28f23578ec..077e2577f384 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx @@ -442,6 +442,16 @@ gtv_application_window_get_child_window_by_id(GtvApplicationWindow* window, cons return ret; } +// temporary function to invalidate all opened dialogs +// because currently the dialog id returned in dialog invalidation payload +// doesn't match our hard-coded list of dialog ids (uno commands) for some dialogs +GList* +gtv_application_window_get_all_child_windows(GtvApplicationWindow* window) +{ + GtvApplicationWindowPrivate* priv = getPrivate(window); + return priv->m_pChildWindows; +} + GtvApplicationWindow* gtv_application_window_new(GtkApplication* app) { diff --git a/libreofficekit/qa/gtktiledviewer/gtv-application-window.hxx b/libreofficekit/qa/gtktiledviewer/gtv-application-window.hxx index c16425566967..239471ae4ac8 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-application-window.hxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-application-window.hxx @@ -105,6 +105,8 @@ void gtv_application_window_unregister_child_window(GtvApplicationWindow* window GtkWindow* gtv_application_window_get_child_window_by_id(GtvApplicationWindow* window, const gchar* pWinId); +GList* gtv_application_window_get_all_child_windows(GtvApplicationWindow* window); + G_END_DECLS #endif /* GTV_APPLICATION_WINDOW_H */ diff --git a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx index 2a620b58000d..7a9fa7712900 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx @@ -63,11 +63,13 @@ pixelToTwip(float fInput) return (fInput / 96 / 1.0 /* zoom */) * 1440.0f; } +#if 0 static float twipToPixel(float fInput) { return fInput / 1440.0f * 96 * 1.0 /* zoom */; } +#endif static void gtv_lok_dialog_draw(GtkWidget* pDialogDrawingArea, cairo_t* pCairo, gpointer) diff --git a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx index a549d852c786..8f86ecd43ca7 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx @@ -281,14 +281,23 @@ void LOKDocViewSigHandlers::comment(LOKDocView* pDocView, gchar* pComment, gpoin } } -void LOKDocViewSigHandlers::dialogInvalidate(LOKDocView* pDocView, gchar* pDialogId, gpointer) +void LOKDocViewSigHandlers::dialogInvalidate(LOKDocView* pDocView, gchar* /*pDialogId*/, gpointer) { GtvApplicationWindow* window = GTV_APPLICATION_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(pDocView))); - GtkWindow* pDialog = gtv_application_window_get_child_window_by_id(window, pDialogId); - if (pDialog) +// GtkWindow* pDialog = gtv_application_window_get_child_window_by_id(window, pDialogId); + + // temporary hack to invalidate all open dialogs + GList* pChildWins = gtv_application_window_get_all_child_windows(window); + GList* pIt = nullptr; + for (pIt = pChildWins; pIt != nullptr; pIt = pIt->next) + { + gtv_lok_dialog_invalidate(GTV_LOK_DIALOG(pIt->data)); + } +/* if (pDialog) { gtv_lok_dialog_invalidate(GTV_LOK_DIALOG(pDialog)); } +*/ } gboolean LOKDocViewSigHandlers::configureEvent(GtkWidget* pWidget, GdkEventConfigure* /*pEvent*/, gpointer /*pData*/) |