diff --git a/xpra/client/mixins/window_manager.py b/xpra/client/mixins/window_manager.py index e1189f6b24..6a67ff2723 100644 --- a/xpra/client/mixins/window_manager.py +++ b/xpra/client/mixins/window_manager.py @@ -31,7 +31,7 @@ ) from xpra.util import ( envint, envbool, typedict, - make_instance, updict, repr_ellipsized, u, noerr, + make_instance, updict, repr_ellipsized, u, noerr, first_time, ) from xpra.client.mixins.stub_client_mixin import StubClientMixin from xpra.log import Logger @@ -683,8 +683,15 @@ def set_tray_icon(self): def _window_icon_image(self, wid, width, height, coding, data): #convert the data into a pillow image, #adding the icon overlay (if enabled) - from PIL import Image # @UnresolvedImport coding = bytestostr(coding) + try: + # pylint: disable=import-outside-toplevel + from PIL import Image + return Image + except ImportError: + if first_time("window-icons-require-pillow"): + log.info("showing window icons requires python-pillow") + return None iconlog("%s.update_icon(%s, %s, %s, %s bytes) ICON_SHRINKAGE=%s, ICON_OVERLAY=%s", self, width, height, coding, len(data), ICON_SHRINKAGE, ICON_OVERLAY) if coding=="default":