summaryrefslogtreecommitdiff
path: root/NxWidgets/nxwm/src/ctaskbar.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'NxWidgets/nxwm/src/ctaskbar.cxx')
-rw-r--r--NxWidgets/nxwm/src/ctaskbar.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/NxWidgets/nxwm/src/ctaskbar.cxx b/NxWidgets/nxwm/src/ctaskbar.cxx
index 031edbf3a..93c38ed98 100644
--- a/NxWidgets/nxwm/src/ctaskbar.cxx
+++ b/NxWidgets/nxwm/src/ctaskbar.cxx
@@ -1,7 +1,7 @@
/********************************************************************************************
* NxWidgets/nxwm/src/ctaskbar.cxx
*
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -456,11 +456,21 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized)
NXWidgets::IBitmap *bitmap = app->getIcon();
- // Create a CImage instance to manage the applications icon
+ // Create a CImage instance to manage the applications icon. Assume the
+ // minimum size in case no bitmap is provided (bitmap == NULL)
+
+ int w = 1;
+ int h = 1;
+
+ if (bitmap)
+ {
+ w = bitmap->getWidth();
+ h = bitmap->getHeight();
+ }
NXWidgets::CImage *image =
- new NXWidgets::CImage(control, 0, 0, bitmap->getWidth(),
- bitmap->getHeight(), bitmap, 0);
+ new NXWidgets::CImage(control, 0, 0, w, h, bitmap, 0);
+
if (!image)
{
return false;