[mutter] window: Fix coding style in meta_window_unqueue()



commit ac5d728abdd9a893e1ba166b8fa954c012ce2c6f
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Sat Jan 29 00:21:59 2022 +0100

    window: Fix coding style in meta_window_unqueue()
    
    As with meta_window_queue(), it had some comments duplicating code, so
    those were removed too to increase readability.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2264>

 src/core/window.c | 30 ++++++++++++------------------
 1 file changed, 12 insertions(+), 18 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 262ec19581..eacde2b470 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -133,7 +133,8 @@ static void     ensure_mru_position_after (MetaWindow *window,
 
 static void meta_window_move_resize_now (MetaWindow  *window);
 
-static void meta_window_unqueue (MetaWindow *window, guint queuebits);
+static void meta_window_unqueue (MetaWindow    *window,
+                                 MetaQueueType  queuebits);
 
 static void     update_move           (MetaWindow              *window,
                                        MetaEdgeResistanceFlags  flags,
@@ -1967,32 +1968,25 @@ static const gchar* meta_window_queue_names[NUMBER_OF_QUEUES] =
 #endif
 
 static void
-meta_window_unqueue (MetaWindow *window, guint queuebits)
+meta_window_unqueue (MetaWindow    *window,
+                     MetaQueueType  queuebits)
 {
-  gint queuenum;
+  int queuenum;
 
-  for (queuenum=0; queuenum<NUMBER_OF_QUEUES; queuenum++)
+  for (queuenum = 0; queuenum < NUMBER_OF_QUEUES; queuenum++)
     {
-      if ((queuebits & 1<<queuenum) /* they have asked to unqueue */
-          &&
-          (window->is_in_queues & 1<<queuenum)) /* it's in the queue */
+      if ((queuebits & 1 << queuenum) &&
+          (window->is_in_queues & 1 << queuenum))
         {
 
           meta_topic (META_DEBUG_WINDOW_STATE,
-              "Removing %s from the %s queue",
-              window->desc,
-              meta_window_queue_names[queuenum]);
+                      "Removing %s from the %s queue",
+                      window->desc,
+                      meta_window_queue_names[queuenum]);
 
-          /* Note that window may not actually be in the queue
-           * because it may have been in "copy" inside the idle handler
-           */
           queue_pending[queuenum] = g_slist_remove (queue_pending[queuenum], window);
-          window->is_in_queues &= ~(1<<queuenum);
+          window->is_in_queues &= ~(1 << queuenum);
 
-          /* Okay, so maybe we've used up all the entries in the queue.
-           * In that case, we should kill the function that deals with
-           * the queue, because there's nothing left for it to do.
-           */
           if (queue_pending[queuenum] == NULL && queue_later[queuenum] != 0)
             {
               meta_later_remove (queue_later[queuenum]);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]