Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions apps/DesktopStreamer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ if(APPLE)

list(APPEND DESKTOPSTREAMER_SOURCES AppNapSuspender.mm)
list(APPEND DESKTOPSTREAMER_LINK_LIBRARIES "-framework Foundation")
if(Qt5MacExtras_FOUND)
list(APPEND DESKTOPSTREAMER_SOURCES DesktopWindowsModel.mm)
list(APPEND DESKTOPSTREAMER_LINK_LIBRARIES
Qt5::MacExtras "-framework AppKit")
if(TARGET Qt5::MacExtras)
option(DESKTOPSTREAMER_ENABLE_MULTIWINDOW "Enable support for streaming multiple windows" OFF)
if(DESKTOPSTREAMER_ENABLE_MULTIWINDOW)
list(APPEND DESKTOPSTREAMER_SOURCES DesktopWindowsModel.mm)
list(APPEND DESKTOPSTREAMER_LINK_LIBRARIES
Qt5::MacExtras "-framework AppKit")
endif()
endif()
if(OSX_VERSION VERSION_LESS 10.9)
list(APPEND DESKTOPSTREAMER_LINK_LIBRARIES "-framework ApplicationServices")
Expand All @@ -52,6 +55,9 @@ endif()
common_application(${DESKTOPSTREAMER_APP_NAME} GUI)

if(APPLE)
if(TARGET Qt5::MacExtras AND DESKTOPSTREAMER_ENABLE_MULTIWINDOW)
target_compile_definitions(${DESKTOPSTREAMER_APP_NAME} PRIVATE DESKTOPSTREAMER_ENABLE_MULTIWINDOW)
endif()
# create a zip for Puppet deployment
install(CODE "execute_process(COMMAND zip -r
${DESKTOPSTREAMER_APP_NAME}-${PROJECT_VERSION}.zip ${DESKTOPSTREAMER_APP_NAME}.app
Expand Down
12 changes: 7 additions & 5 deletions apps/DesktopStreamer/MainWindow.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*********************************************************************/
/* Copyright (c) 2011 - 2012, The University of Texas at Austin. */
/* Copyright (c) 2011-2012, The University of Texas at Austin. */
/* Copyright (c) 2013-2016, EPFL/Blue Brain Project */
/* Raphael Dumusc <raphael.dumusc@epfl.ch> */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
Expand Down Expand Up @@ -57,7 +59,7 @@ typedef __int32 int32_t;
# include <unistd.h>
#endif

#ifdef DEFLECT_USE_QT5MACEXTRAS
#ifdef DESKTOPSTREAMER_ENABLE_MULTIWINDOW
# include "DesktopWindowsModel.h"
#endif

Expand Down Expand Up @@ -103,7 +105,7 @@ MainWindow::MainWindow()
gethostname( hostname, 256 );
_streamIdLineEdit->setText( QString( "%1" ).arg( hostname ));

#ifdef DEFLECT_USE_QT5MACEXTRAS
#ifdef DESKTOPSTREAMER_ENABLE_MULTIWINDOW
_listView->setModel( new DesktopWindowsModel );

// select 'Desktop' item as initial default stream item
Expand Down Expand Up @@ -195,7 +197,7 @@ void MainWindow::_updateStreams()
{
const std::string& host = _getStreamHost();

#ifdef DEFLECT_USE_QT5MACEXTRAS
#ifdef DESKTOPSTREAMER_ENABLE_MULTIWINDOW
const QModelIndexList windowIndices =
_listView->selectionModel()->selectedIndexes();

Expand Down Expand Up @@ -304,7 +306,7 @@ void MainWindow::_shareDesktopUpdate()
}
}

#ifdef DEFLECT_USE_QT5MACEXTRAS
#ifdef DESKTOPSTREAMER_ENABLE_MULTIWINDOW
void MainWindow::_deselect( ConstStreamPtr stream )
{
const QPersistentModelIndex& index = stream->getIndex();
Expand Down
4 changes: 3 additions & 1 deletion apps/DesktopStreamer/MainWindow.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*********************************************************************/
/* Copyright (c) 2011 - 2012, The University of Texas at Austin. */
/* Copyright (c) 2011-2012, The University of Texas at Austin. */
/* Copyright (c) 2013-2016, EPFL/Blue Brain Project */
/* Raphael Dumusc <raphael.dumusc@epfl.ch> */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
Expand Down
10 changes: 5 additions & 5 deletions apps/DesktopStreamer/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "MainWindow.h"

#ifdef __APPLE__
# ifdef DEFLECT_USE_QT5MACEXTRAS
# ifdef DESKTOPSTREAMER_ENABLE_MULTIWINDOW
# include "DesktopWindowsModel.h"
# endif
# if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
Expand Down Expand Up @@ -121,7 +121,7 @@ std::string update()
{
QPixmap pixmap;

#ifdef DEFLECT_USE_QT5MACEXTRAS
#ifdef DESKTOPSTREAMER_ENABLE_MULTIWINDOW
if( !_window.isValid( ))
return "Window does not exist anymore";

Expand All @@ -145,7 +145,7 @@ std::string update()
return "Got no pixmap for desktop or window";

QImage image = pixmap.toImage();
#ifdef DEFLECT_USE_QT5MACEXTRAS
#ifdef DESKTOPSTREAMER_ENABLE_MULTIWINDOW
// render mouse cursor only on active window and full desktop streams
if( DesktopWindowsModel::isActive( _pid ) ||
model->data( _window, Qt::DisplayRole ) == "Desktop" )
Expand Down Expand Up @@ -181,7 +181,7 @@ void _sendMouseEvent( const CGEventType type, const CGMouseButton button,
CGEventRef event = CGEventCreateMouseEvent( 0, type, point, button );
CGEventSetType( event, type );

#ifdef DEFLECT_USE_QT5MACEXTRAS
#ifdef DESKTOPSTREAMER_ENABLE_MULTIWINDOW
// If the destination app is not active, store the event in a queue and
// consume it after it's been activated (next iteration of main run loop)
if( !DesktopWindowsModel::isActive( _pid ))
Expand Down Expand Up @@ -263,7 +263,7 @@ void _sendMouseDoubleClickEvent( const float, const float ) {}
const QImage _cursor;
QImage _image;
const int _pid;
#ifdef DEFLECT_USE_QT5MACEXTRAS
#ifdef __APPLE__
typedef std::queue< CGEventRef > EventQueue;
EventQueue _events;
#endif
Expand Down
2 changes: 2 additions & 0 deletions apps/DesktopStreamer/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*********************************************************************/
/* Copyright (c) 2011 - 2012, The University of Texas at Austin. */
/* Copyright (c) 2013-2016, EPFL/Blue Brain Project */
/* Raphael Dumusc <raphael.dumusc@epfl.ch> */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
Expand Down
5 changes: 4 additions & 1 deletion doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ Changelog {#Changelog}

### 0.11.0 (git master)

* [110](https://github.com/BlueBrain/Deflect/pull/110):
DesktopStreamer: Support for streaming multiple windows on OSX disabled by
default, can be enabled with cmake -DDESKTOPSTREAMER_ENABLE_MULTIWINDOW=ON.
* [106](https://github.com/BlueBrain/Deflect/pull/106):
DesktopStreamer: Rename 'interaction' -> 'remote control', off by default.
* [103](https://github.com/BlueBrain/Deflect/pull/103):
DesktopStreamer: prevent AppNap of being re-enabled automatically
* [102](https://github.com/BlueBrain/Deflect/pull/102):
DeflectQt: Continue rendering & streaming after updates for a while to
compensate for running animations, fix spurious missing event handling
compensate for running animations, fix spurious missing event handling
* [101](https://github.com/BlueBrain/Deflect/pull/101):
DesktopStreamer: windows that are streamed independently are activated
(i.e. sent to the foreground) before applying an interaction event. The mouse
Expand Down