summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-07-29 18:08:21 +0530
committerJan Holesovsky <kendy@collabora.com>2017-11-15 17:07:09 +0100
commit06fee69e240a3ce95f5448fb25892089f5600ba6 (patch)
tree4ff3e5a26b5f496ee10a6b25ab78df72ab0bd1c1 /libreofficekit
parent80bd29066be627d5c1cccfe04cdd4e163c76cc11 (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')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx10
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-application-window.hxx2
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx2
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx15
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 d4395bf0899f..dc3e08381b67 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*/)