summaryrefslogtreecommitdiff
path: root/NxWidgets/libnxwidgets/src
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-02 14:38:54 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-02 14:38:54 +0000
commitaddae64d8c028ffd2c3bb05ec7ebdd1a73720998 (patch)
tree1b921ee8364e6156ee58ee1b85b34a91a69aa435 /NxWidgets/libnxwidgets/src
parent1c9fc6cb19e21749c86389b13196075b97deab73 (diff)
downloadnuttx-addae64d8c028ffd2c3bb05ec7ebdd1a73720998.tar.gz
nuttx-addae64d8c028ffd2c3bb05ec7ebdd1a73720998.tar.bz2
nuttx-addae64d8c028ffd2c3bb05ec7ebdd1a73720998.zip
NxWM initial displays come up okay
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4687 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/libnxwidgets/src')
-rw-r--r--NxWidgets/libnxwidgets/src/cnxtkwindow.cxx19
-rw-r--r--NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx23
2 files changed, 19 insertions, 23 deletions
diff --git a/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx b/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx
index ba62ee435..bae9cb815 100644
--- a/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx
+++ b/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx
@@ -133,23 +133,12 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height)
{
if (m_hNxTkWindow && !m_toolbar)
{
- // Get current window style from the widget control
-
- CWidgetStyle style;
- m_widgetControl->getWidgetStyle(&style);
-
- // Create a new controlling widget for the window
-
- CWidgetControl *widgetControl = new CWidgetControl(&style);
-
- // And create the toolcar
+ // Create the toolbar. Note that we use the SAME underlying
+ // widget control. That is because the tool bar really resides
+ // in the same "physical" window.
m_toolbar = new CNxToolbar(this, m_hNxTkWindow,
- widgetControl, height);
- if (!m_toolbar)
- {
- delete widgetControl;
- }
+ m_widgetControl, height);
}
return m_toolbar;
}
diff --git a/NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx b/NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx
index a6807dad5..1e1c9ce87 100644
--- a/NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx
+++ b/NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx
@@ -104,10 +104,17 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style)
m_nCh = 0;
m_nCc = 0;
- // Enable the semaphore that will wake up the modal loop on mouse or
- // keypress events
-
- sem_init(&m_modalsem, 0, 0);
+ // Intialize semaphores:
+ //
+ // m_modalSem. The semaphore that will wake up the modal loop on mouse or
+ // keypress events
+ // m_geoSem. The semaphore that will synchronize window size and position
+ // informatin.
+
+ sem_init(&m_modalSem, 0, 0);
+#ifdef CONFIG_NX_MULTIUSER
+ sem_init(&m_geoSem, 0, 0);
+#endif
// Do we need to fetch the default style?
@@ -197,7 +204,7 @@ void CWidgetControl::waitForModalEvent(void)
{
// Wait for an interesting event (like a mouse or keyboard event)
- (void)sem_wait(&m_modalsem);
+ (void)sem_wait(&m_modalSem);
}
}
@@ -209,7 +216,7 @@ void CWidgetControl::wakeupModalLoop(void)
{
if (m_modal)
{
- (void)sem_post(&m_modalsem);
+ (void)sem_post(&m_modalSem);
}
}
@@ -227,7 +234,7 @@ void CWidgetControl::stopModal(void)
// Wake up the modal loop so that it can terminate properly
- (void)sem_post(&m_modalsem);
+ (void)sem_post(&m_modalSem);
}
}
@@ -885,7 +892,7 @@ void CWidgetControl::takeGeoSem(void)
int ret;
do
{
- ret = sem_wait(&m_geosem);
+ ret = sem_wait(&m_geoSem);
}
while (ret < 0 && errno == EINTR);
}