]> git.lizzy.rs Git - bspwm.git/blobdiff - monitor.c
Be verbose regarding broken connections
[bspwm.git] / monitor.c
index 5162d5a82eeff42a24d7a77401b782e7a6f98be0..da31a725e6cc24466939c41adce48ce4552a807a 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014, Bastien Dejean
+/* Copyright (c) 2012, Bastien Dejean
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those
- * of the authors and should not be interpreted as representing official policies,
- * either expressed or implied, of the FreeBSD Project.
  */
 
 #include <limits.h>
@@ -139,7 +135,7 @@ void focus_monitor(monitor_t *m)
        mon = m;
 
        if (pointer_follows_monitor)
-               center_pointer(m);
+               center_pointer(m->rectangle);
 
        ewmh_update_current_desktop();
        put_status();
@@ -403,8 +399,13 @@ bool update_monitors(void)
                                                        contains(mb->rectangle, m->rectangle)) {
                                                if (mm == m)
                                                        mm = mb;
-                                               merge_monitors(m, mb);
-                                               remove_monitor(m);
+                                               if (m->desk != NULL && mb->desk == NULL && contains(m->rectangle, mb->rectangle)) {
+                                                       mm = m;
+                                                       remove_monitor(mb);
+                                               } else {
+                                                       merge_monitors(m, mb);
+                                                       remove_monitor(m);
+                                               }
                                                break;
                                        }
                        }