From fdb56a741a66e152f0f120d00bf62049fe566a79 Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Thu, 26 Oct 2017 18:31:39 -0700 Subject: lokdialog: Tunnel dialog title to lokclient as outparam Change-Id: I1beb5ab3f06debdca7ebf999af7ac879a41ea47e Reviewed-on: https://gerrit.libreoffice.org/43959 Tested-by: Jenkins Reviewed-by: pranavk --- libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'libreofficekit') diff --git a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx index 6948b842f633..f65f2f023bef 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx @@ -87,14 +87,20 @@ gtv_lok_dialog_draw(GtkWidget* pDialogDrawingArea, cairo_t* pCairo, gpointer) GtvLokDialog* pDialog = GTV_LOK_DIALOG(gtk_widget_get_toplevel(pDialogDrawingArea)); GtvLokDialogPrivate* priv = getPrivate(pDialog); - - g_info("painting dialog"); + g_info("panting dialog"); int nWidth = 1024; int nHeight = 768; cairo_surface_t* pSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, nWidth, nHeight); unsigned char* pBuffer = cairo_image_surface_get_data(pSurface); LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(LOK_DOC_VIEW(priv->lokdocview)); - pDocument->pClass->paintDialog(pDocument, priv->dialogid, pBuffer, &nWidth, &nHeight); + char* pDialogTitle = nullptr; + pDocument->pClass->paintDialog(pDocument, priv->dialogid, pBuffer, &pDialogTitle, &nWidth, &nHeight); + if (pDialogTitle) + { + gtk_window_set_title(GTK_WINDOW(pDialog), pDialogTitle); + free(pDialogTitle); + } + gtk_widget_set_size_request(GTK_WIDGET(pDialogDrawingArea), nWidth, nHeight); cairo_surface_flush(pSurface); @@ -472,7 +478,6 @@ gtv_lok_dialog_invalidate(GtvLokDialog* dialog) { GtvLokDialogPrivate* priv = getPrivate(dialog); - // trigger a draw on the dialog drawing area gtk_widget_queue_draw(priv->pDialogDrawingArea); } @@ -597,7 +602,7 @@ void gtv_lok_dialog_child_invalidate(GtvLokDialog* dialog, int nX, int nY) g_info("Dialog's floating window invalidate"); GtvLokDialogPrivate* priv = getPrivate(dialog); - // remove any existing floating windows, for now + // create new if doesn't exist if (!priv->pFloatingWin) { priv->pFloatingWin = gtk_window_new(GTK_WINDOW_POPUP); -- cgit