@@ -295,6 +295,9 @@ function window_i:backlog_update_()
295295end
296296
297297function window_i :backlog_push_ (collect , important )
298+ if self .silent_ then
299+ important = false
300+ end
298301 self .backlog_unique_ = self .backlog_unique_ + 1
299302 local msg = {
300303 unique = self .backlog_unique_ ,
@@ -323,6 +326,10 @@ function window_i:backlog_push_str(str, important)
323326 end
324327end
325328
329+ function window_i :backlog_mark_seen ()
330+ self .backlog_last_seen_ = self .backlog_last_wrapped_
331+ end
332+
326333function window_i :backlog_bump_marker ()
327334 self .backlog_enable_marker_ = false
328335 if self .backlog_last_seen_ < self .backlog_unique_ then
@@ -395,7 +402,7 @@ function window_i:handle_tick()
395402 local now = socket .gettime ()
396403
397404 if self .backlog_auto_scroll_ and not floating then
398- self . backlog_last_seen_ = self . backlog_last_wrapped_
405+ self : backlog_mark_seen ()
399406 else
400407 if self .backlog_last_seen_ < self .backlog_unique_ and not self .backlog_enable_marker_ then
401408 self :backlog_bump_marker ()
@@ -580,10 +587,15 @@ function window_i:handle_mousedown(px, py, button)
580587 end
581588end
582589
590+ function window_i :hide_window ()
591+ self :backlog_mark_seen ()
592+ self .hide_window_func_ ()
593+ end
594+
583595function window_i :handle_mouseup (px , py , button )
584596 if button == ui .SDL_BUTTON_LEFT then
585597 if self .close_active_ then
586- self . hide_window_func_ ()
598+ self : hide_window ()
587599 end
588600 self .resizer_active_ = false
589601 self .dragger_active_ = false
@@ -652,7 +664,7 @@ function window_i:handle_keypress(key, scan, rep, shift, ctrl, alt)
652664 self :input_reset_ ()
653665 end
654666 if shift or force_hide then
655- self . hide_window_func_ ()
667+ self : hide_window ()
656668 end
657669 else
658670 self .in_focus = true
@@ -783,7 +795,7 @@ function window_i:handle_keypress(key, scan, rep, shift, ctrl, alt)
783795 if self .hide_when_chat_done then
784796 self .hide_when_chat_done = false
785797 self .in_focus = false
786- self . hide_window_func_ ()
798+ self : hide_window ()
787799 end
788800 end
789801 else
@@ -870,7 +882,7 @@ function window_i:handle_keypress(key, scan, rep, shift, ctrl, alt)
870882 return not modkey_scan [scan ]
871883 else
872884 if not ctrl and not alt and scan == ui .SDL_SCANCODE_ESCAPE then
873- self . hide_window_func_ ()
885+ self : hide_window ()
874886 return true
875887 end
876888 end
@@ -925,6 +937,10 @@ local function set_size_clamp(new_width, new_height, new_pos_x, new_pos_y)
925937 return width , height , pos_x , pos_y
926938end
927939
940+ function window_i :set_silent (silent )
941+ self .silent_ = silent
942+ end
943+
928944function window_i :set_size (new_width , new_height )
929945 self .width_ , self .height_ , self .pos_x_ , self .pos_y_ = set_size_clamp (new_width , new_height , self .pos_x_ , self .pos_y_ )
930946 self :input_update_ ()
@@ -1127,6 +1143,7 @@ local function new(params)
11271143 local title_width = gfx .textSize (title )
11281144 local win = setmetatable ({
11291145 in_focus = false ,
1146+ silent_ = false ,
11301147 pos_x_ = pos_x ,
11311148 pos_y_ = pos_y ,
11321149 width_ = width ,
0 commit comments