Merge lp:~alan-griffiths/compiz-core/more-PrivateScreen-tidy-up into lp:compiz-core/0.9.8

Proposed by Alan Griffiths
Status: Merged
Merged at revision: 3129
Proposed branch: lp:~alan-griffiths/compiz-core/more-PrivateScreen-tidy-up
Merge into: lp:compiz-core/0.9.8
Diff against target: 334 lines (+133/-130)
2 files modified
src/privatescreen.h (+98/-100)
src/screen.cpp (+35/-30)
To merge this branch: bzr merge lp:~alan-griffiths/compiz-core/more-PrivateScreen-tidy-up
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
Review via email: mp+104938@code.launchpad.net

Description of the change

More tidy-up of PrivateScreen code

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/privatescreen.h'
--- src/privatescreen.h 2012-05-04 11:55:34 +0000
+++ src/privatescreen.h 2012-05-07 16:39:19 +0000
@@ -75,11 +75,13 @@
7575
76 int outputDeviceForGeometry(const CompWindow::Geometry& gm, int strategy,76 int outputDeviceForGeometry(const CompWindow::Geometry& gm, int strategy,
77 CompScreen* screen) const;77 CompScreen* screen) const;
78 void updateOutputDevices(CoreOptions& coreOptions, CompScreen* screen);
79
80private:
78 void setGeometryOnDevice(unsigned int nOutput, int x, int y,81 void setGeometryOnDevice(unsigned int nOutput, int x, int y,
79 const int width, const int height);82 const int width, const int height);
80 void adoptDevices(unsigned int nOutput);83 void adoptDevices(unsigned int nOutput);
8184
82private:
83 static CompRect computeWorkareaForBox(const CompRect& box,85 static CompRect computeWorkareaForBox(const CompRect& box,
84 const CompWindowList& windows);86 const CompWindowList& windows);
8587
@@ -712,105 +714,101 @@
712 int getXkbEvent() const { return xkbEvent.get(); }714 int getXkbEvent() const { return xkbEvent.get(); }
713 std::vector<XineramaScreenInfo>& getScreenInfo () { return screenInfo; }715 std::vector<XineramaScreenInfo>& getScreenInfo () { return screenInfo; }
714 SnDisplay* getSnDisplay () const { return snDisplay; }716 SnDisplay* getSnDisplay () const { return snDisplay; }
715 char const* displayString () const { return displayString_; }717 const char* displayString() const
716 CompRegion const& getRegion () const { return region; }718 {
717 XWindowAttributes const& getAttrib () const { return attrib; }719 return displayString_;
718 Window rootWindow() const { return root; }720 }
719 void identifyEdgeWindow(Window id);721
720722 const CompRegion& getRegion() const
721 void setPlugins(CompOption::Value::Vector const& vList);723 {
722 void initPlugins();724 return region;
723725 }
724 void updateClientList () { windowManager.updateClientList (*this); }726
725727 const XWindowAttributes& getAttrib() const
726 void detectOutputDevices (CoreOptions& coreOptions);728 {
727 void updateOutputDevices (CoreOptions& coreOptions);729 return attrib;
728730 }
729 public:731
730 Display *dpy;732 Window rootWindow() const
731 ::compiz::private_screen::Extension xSync;733 {
732 ::compiz::private_screen::Extension xRandr;734 return root;
733 ::compiz::private_screen::Extension xShape;735 }
734 ::compiz::private_screen::History history;736
735737 void identifyEdgeWindow(Window id);
736 ::compiz::private_screen::ViewPort viewPort;738 void setPlugins(const CompOption::Value::Vector& vList);
737 ::compiz::private_screen::StartupSequenceImpl startupSequence;739 void initPlugins();
738 ::compiz::private_screen::GrabManager grabManager;740
739 ::compiz::private_screen::EventManager eventManager;741 void updateClientList()
740 ::compiz::private_screen::Ping ping;742 {
741 ::compiz::private_screen::OrphanData orphanData;743 windowManager.updateClientList(*this);
742 ::compiz::private_screen::OutputDevices outputDevices;744 }
743 ::compiz::private_screen::WindowManager windowManager;745
744746 void detectOutputDevices(CoreOptions& coreOptions);
745 private:747 void updateOutputDevices(CoreOptions& coreOptions);
746 CompScreen* screen;748
747 ::compiz::private_screen::Extension xkbEvent;749public:
748750 Display* dpy;
749 //TODO? Pull these two out as a class?751 compiz::private_screen::Extension xSync;
750 bool xineramaExtension;752 compiz::private_screen::Extension xRandr;
751 std::vector<XineramaScreenInfo> screenInfo;753 compiz::private_screen::Extension xShape;
752754 compiz::private_screen::History history;
753 SnDisplay *snDisplay;755 compiz::private_screen::ViewPort viewPort;
754756 compiz::private_screen::StartupSequenceImpl startupSequence;
755 char displayString_[256];757 compiz::private_screen::GrabManager grabManager;
756758 compiz::private_screen::EventManager eventManager;
757 KeyCode escapeKeyCode;759 compiz::private_screen::Ping ping;
758 KeyCode returnKeyCode;760 compiz::private_screen::OrphanData orphanData;
759761 compiz::private_screen::OutputDevices outputDevices;
760 public:762 compiz::private_screen::WindowManager windowManager;
761 Colormap colormap;763
762 int screenNum;764 Colormap colormap;
763765 int screenNum;
764 unsigned int nDesktop;766 unsigned int nDesktop;
765 unsigned int currentDesktop;767 unsigned int currentDesktop;
766768
767 private:769 CompOutput fullscreenOutput;
768 CompRegion region;770 CompScreenEdge screenEdge[SCREEN_EDGE_NUM];
769771
770 Window root;772 Window wmSnSelectionWindow;
771773
772 XWindowAttributes attrib;774 Cursor normalCursor;
773 public:775 Cursor busyCursor;
774776 Cursor invisibleCursor;
775 CompOutput fullscreenOutput;777 CompRect workArea;
776778 unsigned int showingDesktopMask;
777 CompScreenEdge screenEdge[SCREEN_EDGE_NUM];779
778780 bool initialized;
779 private:781
780 SnMonitorContext *snContext;782private:
781783 bool handlePingTimeout();
782 public:784
783 Window wmSnSelectionWindow;785 CompScreen* screen;
784 private:786 compiz::private_screen::Extension xkbEvent;
785 Atom wmSnAtom;787 //TODO? Pull these two out as a class?
786 Time wmSnTimestamp;788 bool xineramaExtension;
787789 std::vector<XineramaScreenInfo> screenInfo;
788 public:790 SnDisplay* snDisplay;
789 Cursor normalCursor;791 char displayString_[256];
790 Cursor busyCursor;792 KeyCode escapeKeyCode;
791 Cursor invisibleCursor;793 KeyCode returnKeyCode;
792794
793 CompRect workArea;795 CompRegion region;
794796 Window root;
795 unsigned int showingDesktopMask;797 XWindowAttributes attrib;
796798
797 private:799 SnMonitorContext* snContext;
798 unsigned long *desktopHintData;800
799 int desktopHintSize;801 Atom wmSnAtom;
800802 Time wmSnTimestamp;
801 public:803
802 bool initialized;804 unsigned long *desktopHintData;
803805 int desktopHintSize;
804 private:806
805 bool handlePingTimeout ();807 Window edgeWindow;
806808 CompTimer pingTimer;
807 Window edgeWindow;809 CompTimer edgeDelayTimer;
808810 CompDelayedEdgeSettings edgeDelaySettings;
809 CompTimer pingTimer;811 Window xdndWindow;compiz::private_screen::PluginManager pluginManager;
810 CompTimer edgeDelayTimer;
811 CompDelayedEdgeSettings edgeDelaySettings;
812 Window xdndWindow;
813 ::compiz::private_screen::PluginManager pluginManager;
814};812};
815813
816class CompManager814class CompManager
817815
=== modified file 'src/screen.cpp'
--- src/screen.cpp 2012-05-04 11:55:34 +0000
+++ src/screen.cpp 2012-05-07 16:39:19 +0000
@@ -1988,32 +1988,32 @@
1988 if (outputDevs[i].intersects(outputDevs[j]))1988 if (outputDevs[i].intersects(outputDevs[j]))
1989 overlappingOutputs = true;1989 overlappingOutputs = true;
1990}1990}
1991
1991void1992void
1992PrivateScreen::updateOutputDevices (CoreOptions& coreOptions)1993cps::OutputDevices::updateOutputDevices(CoreOptions& coreOptions, CompScreen* screen)
1993{1994{
1994 CompOption::Value::Vector &list = coreOptions.optionGetOutputs ();1995 CompOption::Value::Vector& list = coreOptions.optionGetOutputs();
1995 unsigned int nOutput = 0;1996 unsigned int nOutput = 0;
1996 int x, y, bits;1997 int x, y, bits;
1997 unsigned int uWidth, uHeight;1998 unsigned int uWidth, uHeight;
1998 int width, height;1999 int width, height;
1999 int x1, y1, x2, y2;2000 int x1, y1, x2, y2;
20002001 foreach(CompOption::Value & value, list)
2001 foreach (CompOption::Value &value, list)
2002 {2002 {
2003 x = 0;2003 x = 0;
2004 y = 0;2004 y = 0;
2005 uWidth = (unsigned) screen->width ();2005 uWidth = (unsigned) screen->width();
2006 uHeight = (unsigned) screen->height ();2006 uHeight = (unsigned) screen->height();
20072007
2008 bits = XParseGeometry (value.s ().c_str (), &x, &y, &uWidth, &uHeight);2008 bits = XParseGeometry(value.s().c_str(), &x, &y, &uWidth, &uHeight);
2009 width = (int) uWidth;2009 width = (int) uWidth;
2010 height = (int) uHeight;2010 height = (int) uHeight;
20112011
2012 if (bits & XNegative)2012 if (bits & XNegative)
2013 x = screen->width () + x - width;2013 x = screen->width() + x - width;
20142014
2015 if (bits & YNegative)2015 if (bits & YNegative)
2016 y = screen->height () + y - height;2016 y = screen->height() + y - height;
20172017
2018 x1 = x;2018 x1 = x;
2019 y1 = y;2019 y1 = y;
@@ -2024,19 +2024,24 @@
2024 x1 = 0;2024 x1 = 0;
2025 if (y1 < 0)2025 if (y1 < 0)
2026 y1 = 0;2026 y1 = 0;
2027 if (x2 > screen->width ())2027 if (x2 > screen->width())
2028 x2 = screen->width ();2028 x2 = screen->width();
2029 if (y2 > screen->height ())2029 if (y2 > screen->height())
2030 y2 = screen->height ();2030 y2 = screen->height();
20312031
2032 if (x1 < x2 && y1 < y2)2032 if (x1 < x2 && y1 < y2)
2033 {2033 {
2034 outputDevices.setGeometryOnDevice(nOutput, x1, y1, x2 - x1, y2 - y1);2034 setGeometryOnDevice(nOutput, x1, y1, x2 - x1, y2 - y1);
2035 nOutput++;2035 nOutput++;
2036 }2036 }
2037 }2037 }
2038 adoptDevices(nOutput);
2039}
20382040
2039 outputDevices.adoptDevices(nOutput);2041void
2042PrivateScreen::updateOutputDevices (CoreOptions& coreOptions)
2043{
2044 outputDevices.updateOutputDevices(coreOptions, screen);
20402045
2041 /* clear out fullscreen monitor hints of all windows as2046 /* clear out fullscreen monitor hints of all windows as
2042 suggested on monitor layout changes in EWMH */2047 suggested on monitor layout changes in EWMH */
@@ -5224,22 +5229,22 @@
5224 startupSequence(this),5229 startupSequence(this),
5225 grabManager (screen),5230 grabManager (screen),
5226 eventManager (),5231 eventManager (),
5227 screen(screen),
5228 screenInfo (),
5229 snDisplay(0),
5230 nDesktop (1),5232 nDesktop (1),
5231 currentDesktop (0),5233 currentDesktop (0),
5232 root(None),
5233 snContext (0),
5234 wmSnSelectionWindow (None),5234 wmSnSelectionWindow (None),
5235 wmSnAtom (None),
5236 normalCursor (None),5235 normalCursor (None),
5237 busyCursor (None),5236 busyCursor (None),
5238 invisibleCursor (None),5237 invisibleCursor (None),
5239 showingDesktopMask (0),5238 showingDesktopMask (0),
5239 initialized (false),
5240 screen(screen),
5241 screenInfo (),
5242 snDisplay(0),
5243 root(None),
5244 snContext (0),
5245 wmSnAtom (None),
5240 desktopHintData (0),5246 desktopHintData (0),
5241 desktopHintSize (0),5247 desktopHintSize (0),
5242 initialized (false),
5243 edgeWindow (None),5248 edgeWindow (None),
5244 edgeDelayTimer (),5249 edgeDelayTimer (),
5245 xdndWindow (None)5250 xdndWindow (None)

Subscribers

People subscribed via source and target branches