Kaydet (Commit) 0f78547e authored tarafından Pranav Kant's avatar Pranav Kant

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
üst 9f6bf0c0
......@@ -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)
{
......
......@@ -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 */
......
......@@ -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)
......
......@@ -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*/)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment