[rkward-cvs] SF.net SVN: rkward-code:[4711] trunk/rkward/rkward
tfry at users.sf.net
tfry at users.sf.net
Tue Apr 23 09:13:29 UTC 2013
Revision: 4711
http://sourceforge.net/p/rkward/code/4711
Author: tfry
Date: 2013-04-23 09:13:27 +0000 (Tue, 23 Apr 2013)
Log Message:
-----------
Some details on RK() device: Initial sizing, window title
Modified Paths:
--------------
trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h
trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
trunk/rkward/rkward/windows/rkwindowcatcher.cpp
Modified: trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp 2013-04-23 07:31:43 UTC (rev 4710)
+++ trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.cpp 2013-04-23 09:13:27 UTC (rev 4711)
@@ -228,6 +228,7 @@
if (active) view->setWindowTitle (i18n ("%1 (Active)").arg (base_title));
else view->setWindowTitle (i18n ("%1 (Inactive)").arg (base_title));
emit (activeChanged (active));
+ emit (captionChanged (view->windowTitle ()));
}
void RKGraphicsDevice::locator () {
Modified: trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h
===================================================================
--- trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h 2013-04-23 07:31:43 UTC (rev 4710)
+++ trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice.h 2013-04-23 09:13:27 UTC (rev 4711)
@@ -64,6 +64,7 @@
void activeChanged (bool);
void locatorDone (bool ok, double x, double y);
void newPageConfirmDone (bool accepted);
+ void captionChanged (const QString &caption);
private slots:
void updateNow ();
void newPageDialogDone (int result);
Modified: trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp 2013-04-23 07:31:43 UTC (rev 4710)
+++ trunk/rkward/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp 2013-04-23 09:13:27 UTC (rev 4711)
@@ -173,7 +173,7 @@
quint8 opcode, devnum;
streamer.instream >> opcode >> devnum;
- RK_DEBUG (GRAPHICS_DEVICE, DL_DEBUG, "Received transmission of type %d, devnum %d, size %d", opcode, devnum, streamer.inSize ());
+ RK_DEBUG (GRAPHICS_DEVICE, DL_DEBUG, "Received transmission of type %d, devnum %d, size %d", opcode, devnum+1, streamer.inSize ());
RKGraphicsDevice *device = 0;
if (devnum && opcode == RKDCreate) {
@@ -198,7 +198,7 @@
streamer.outstream << (qint32) desktop->physicalDpiX () << (qint32) desktop->physicalDpiY ();
streamer.writeOutBuffer ();
} else {
- RK_DEBUG (GRAPHICS_DEVICE, DL_ERROR, "Received transmission of type %d for unknown device number %d. Skippping.", opcode, devnum);
+ if (devnum) RK_DEBUG (GRAPHICS_DEVICE, DL_ERROR, "Received transmission of type %d for unknown device number %d. Skippping.", opcode, devnum+1);
sendDummyReply (opcode);
}
continue;
@@ -302,11 +302,11 @@
device->confirmNewPage ();
#warning TODO keep track of status
} else {
- RK_DEBUG (GRAPHICS_DEVICE, DL_ERROR, "Unhandled operation of type %d for device number %d. Skippping.", opcode, devnum);
+ RK_DEBUG (GRAPHICS_DEVICE, DL_ERROR, "Unhandled operation of type %d for device number %d. Skippping.", opcode, devnum+1);
}
if (!streamer.instream.atEnd ()) {
- RK_DEBUG (GRAPHICS_DEVICE, DL_ERROR, "Failed to read all data for operation of type %d on device number %d.", opcode, devnum);
+ RK_DEBUG (GRAPHICS_DEVICE, DL_ERROR, "Failed to read all data for operation of type %d on device number %d.", opcode, devnum+1);
}
}
}
Modified: trunk/rkward/rkward/windows/rkwindowcatcher.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkwindowcatcher.cpp 2013-04-23 07:31:43 UTC (rev 4710)
+++ trunk/rkward/rkward/windows/rkwindowcatcher.cpp 2013-04-23 09:13:27 UTC (rev 4711)
@@ -180,11 +180,12 @@
commonInit (device_number);
rk_native_device = rkward_device;
xembed_container->setFixedSize (rk_native_device->viewPort ()->size ());
+ resize (xembed_container->size ());
rk_native_device->viewPort ()->setParent (xembed_container);
+ connect (rkward_device, SIGNAL (captionChanged(const QString&)), this, SLOT (setCaption(const QString &)));
+ setCaption (rkward_device->viewPort ()->windowTitle ());
-// adjust to size
-// dynamic_size_action->setChecked (true);
- fixedSizeToggled ();
+ QTimer::singleShot (0, this, SLOT (doEmbed()));
}
void RKCaughtX11Window::commonInit (int device_number) {
@@ -192,6 +193,7 @@
capture = 0;
rk_native_device = 0;
+ embedded = 0;
killed_in_r = close_attempted = false;
RKCaughtX11Window::device_number = device_number;
RK_ASSERT (!device_windows.contains (device_number));
@@ -226,22 +228,24 @@
void RKCaughtX11Window::doEmbed () {
RK_TRACE (MISC);
+ if (embedded) {
#ifdef Q_WS_WIN
- capture = new QWinHost (xembed_container);
- capture->setWindow (embedded);
- capture->setFocusPolicy (Qt::ClickFocus);
- capture->setAutoDestruct (true);
- connect (capture, SIGNAL (clientDestroyed()), this, SLOT (deleteLater()), Qt::QueuedConnection);
- connect (capture, SIGNAL (clientTitleChanged(const QString&)), this, SLOT (setCaption(const QString&)), Qt::QueuedConnection);
+ capture = new QWinHost (xembed_container);
+ capture->setWindow (embedded);
+ capture->setFocusPolicy (Qt::ClickFocus);
+ capture->setAutoDestruct (true);
+ connect (capture, SIGNAL (clientDestroyed()), this, SLOT (deleteLater()), Qt::QueuedConnection);
+ connect (capture, SIGNAL (clientTitleChanged(const QString&)), this, SLOT (setCaption(const QString&)), Qt::QueuedConnection);
- setCaption (capture->getClientTitle ());
+ setCaption (capture->getClientTitle ());
#elif defined Q_WS_X11
- capture = new QX11EmbedContainer (xembed_container);
- capture->embedClient (embedded);
- connect (capture, SIGNAL (clientClosed ()), this, SLOT (deleteLater ()));
+ capture = new QX11EmbedContainer (xembed_container);
+ capture->embedClient (embedded);
+ connect (capture, SIGNAL (clientClosed ()), this, SLOT (deleteLater ()));
- RKWardApplication::getApp ()->registerNameWatcher (embedded, this);
+ RKWardApplication::getApp ()->registerNameWatcher (embedded, this);
#endif
+ }
// make xembed_container resizable, again, now that it actually has a content
dynamic_size_action->setChecked (true);
fixedSizeToggled ();
@@ -261,7 +265,7 @@
close (false);
#ifdef Q_WS_X11
- RKWardApplication::getApp ()->unregisterNameWatcher (embedded);
+ if (embedded) RKWardApplication::getApp ()->unregisterNameWatcher (embedded);
#endif
error_dialog->autoDeleteWhenDone ();
delete status_popup;
More information about the rkward-tracker
mailing list