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>
This commit is contained in:
Jonas Ådahl 2022-01-28 22:18:12 +01:00 committed by Marge Bot
parent b5d873a8ac
commit 73c010d8b0

View File

@ -2044,7 +2044,6 @@ meta_window_queue (MetaWindow *window,
{ {
unsigned int queuenum; unsigned int queuenum;
/* Easier to debug by checking here rather than in the idle */
g_return_if_fail (!window->override_redirect || g_return_if_fail (!window->override_redirect ||
(queuebits & META_QUEUE_MOVE_RESIZE) == 0); (queuebits & META_QUEUE_MOVE_RESIZE) == 0);
@ -2052,11 +2051,6 @@ meta_window_queue (MetaWindow *window,
{ {
if (queuebits & 1 << queuenum) 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] = const MetaLaterType window_queue_later_when[NUMBER_OF_QUEUES] =
{ {
META_LATER_CALC_SHOWING, /* CALC_SHOWING */ META_LATER_CALC_SHOWING, /* CALC_SHOWING */
@ -2071,15 +2065,9 @@ meta_window_queue (MetaWindow *window,
idle_update_icon, idle_update_icon,
}; };
/* If we're about to drop the window, there's no point in putting
* it on a queue.
*/
if (window->unmanaging) if (window->unmanaging)
break; 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) if (window->is_in_queues & 1 << queuenum)
break; break;
@ -2088,15 +2076,8 @@ meta_window_queue (MetaWindow *window,
window->desc, window->desc,
meta_window_queue_names[queuenum]); meta_window_queue_names[queuenum]);
/* So, mark it as being in this queue. */
window->is_in_queues |= 1 << queuenum; 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) if (queue_later[queuenum] == 0)
{ {
queue_later[queuenum] = queue_later[queuenum] =
@ -2106,7 +2087,6 @@ meta_window_queue (MetaWindow *window,
NULL); NULL);
} }
/* And now we actually put it on the queue. */
queue_pending[queuenum] = g_slist_prepend (queue_pending[queuenum], queue_pending[queuenum] = g_slist_prepend (queue_pending[queuenum],
window); window);
} }