[mutter] window: Remove musings from meta_window_queue()



commit 73c010d8b00a4193f8f864c069378fa6d4b55444
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Jan 28 22:18:12 2022 +0100

    window: Remove musings from meta_window_queue()
    
    The comments in this function tells a story of C programmer self
    reflecting about data types and Perl. While that can be nice, the rest
    consisted mostly of repeating what the code line below did, with the end
    result being that the function didn't fit on screen, resulting in worse
    readability overall.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2264>

 src/core/window.c | 20 --------------------
 1 file changed, 20 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 1b7464e750..9a82a9e68c 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -2044,7 +2044,6 @@ meta_window_queue (MetaWindow   *window,
 {
   unsigned int queuenum;
 
-  /* Easier to debug by checking here rather than in the idle */
   g_return_if_fail (!window->override_redirect ||
                     (queuebits & META_QUEUE_MOVE_RESIZE) == 0);
 
@@ -2052,11 +2051,6 @@ meta_window_queue (MetaWindow   *window,
     {
       if (queuebits & 1 << queuenum)
         {
-          /* Data which varies between queues.
-           * Yes, these do look a lot like associative arrays:
-           * I seem to be turning into a Perl programmer.
-           */
-
           const MetaLaterType window_queue_later_when[NUMBER_OF_QUEUES] =
             {
               META_LATER_CALC_SHOWING, /* CALC_SHOWING */
@@ -2071,15 +2065,9 @@ meta_window_queue (MetaWindow   *window,
               idle_update_icon,
             };
 
-          /* If we're about to drop the window, there's no point in putting
-           * it on a queue.
-           */
           if (window->unmanaging)
             break;
 
-          /* If the window already claims to be in that queue, there's no
-           * point putting it in the queue.
-           */
           if (window->is_in_queues & 1 << queuenum)
             break;
 
@@ -2088,15 +2076,8 @@ meta_window_queue (MetaWindow   *window,
                       window->desc,
                       meta_window_queue_names[queuenum]);
 
-          /* So, mark it as being in this queue. */
           window->is_in_queues |= 1 << queuenum;
 
-          /* There's not a lot of point putting things into a queue if
-           * nobody's on the other end pulling them out. Therefore,
-           * let's check to see whether an idle handler exists to do
-           * that. If not, we'll create one.
-           */
-
           if (queue_later[queuenum] == 0)
             {
               queue_later[queuenum] =
@@ -2106,7 +2087,6 @@ meta_window_queue (MetaWindow   *window,
                                 NULL);
             }
 
-          /* And now we actually put it on the queue. */
           queue_pending[queuenum] = g_slist_prepend (queue_pending[queuenum],
                                                      window);
       }


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