Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm.c12
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c4
-rw-r--r--source/blender/windowmanager/intern/wm_files.c16
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c2
5 files changed, 22 insertions, 14 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 4460a1167ff..3c7a7676a63 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -369,8 +369,10 @@ void WM_check(bContext *C)
wm = CTX_data_main(C)->wm.first;
CTX_wm_manager_set(C, wm);
}
- if (wm == NULL) return;
- if (wm->windows.first == NULL) return;
+
+ if (wm == NULL || BLI_listbase_is_empty(&wm->windows)) {
+ return;
+ }
if (!G.background) {
/* case: fileread */
@@ -401,8 +403,10 @@ void wm_clear_default_size(bContext *C)
wm = CTX_data_main(C)->wm.first;
CTX_wm_manager_set(C, wm);
}
- if (wm == NULL) return;
- if (wm->windows.first == NULL) return;
+
+ if (wm == NULL || BLI_listbase_is_empty(&wm->windows)) {
+ return;
+ }
for (win = wm->windows.first; win; win = win->next) {
win->sizex = 0;
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index b220954b5b9..b406f6f862f 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2114,7 +2114,9 @@ static void wm_paintcursor_test(bContext *C, wmEvent *event)
static void wm_event_drag_test(wmWindowManager *wm, wmWindow *win, wmEvent *event)
{
- if (wm->drags.first == NULL) return;
+ if (BLI_listbase_is_empty(&wm->drags)) {
+ return;
+ }
if (event->type == MOUSEMOVE)
win->screen->do_draw_drag = TRUE;
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 7bbf78ef089..03f717f0737 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -140,7 +140,7 @@ static void wm_window_match_init(bContext *C, ListBase *wmlist)
wmWindow *win, *active_win;
*wmlist = G.main->wm;
- G.main->wm.first = G.main->wm.last = NULL;
+ BLI_listbase_clear(&G.main->wm);
active_win = CTX_wm_window(C);
@@ -193,7 +193,7 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
wmWindow *oldwin, *win;
/* cases 1 and 2 */
- if (oldwmlist->first == NULL) {
+ if (BLI_listbase_is_empty(oldwmlist)) {
if (G.main->wm.first) {
/* nothing todo */
}
@@ -205,7 +205,7 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
/* cases 3 and 4 */
/* we've read file without wm..., keep current one entirely alive */
- if (G.main->wm.first == NULL) {
+ if (BLI_listbase_is_empty(&G.main->wm)) {
bScreen *screen = NULL;
/* when loading without UI, no matching needed */
@@ -244,7 +244,7 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
wm->defaultconf = oldwm->defaultconf;
wm->userconf = oldwm->userconf;
- oldwm->keyconfigs.first = oldwm->keyconfigs.last = NULL;
+ BLI_listbase_clear(&oldwm->keyconfigs);
oldwm->addonconf = NULL;
oldwm->defaultconf = NULL;
oldwm->userconf = NULL;
@@ -588,7 +588,7 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c
if (BLI_access(startstr, R_OK) == 0) {
success = (BKE_read_file(C, startstr, NULL) != BKE_READ_FILE_FAIL);
}
- if (U.themes.first == NULL) {
+ if (BLI_listbase_is_empty(&U.themes)) {
if (G.debug & G_DEBUG)
printf("\nNote: No (valid) '%s' found, fall back to built-in default.\n\n", startstr);
success = 0;
@@ -602,7 +602,9 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c
if (success == 0) {
success = BKE_read_file_from_memory(C, datatoc_startup_blend, datatoc_startup_blend_size, NULL, true);
- if (wmbase.first == NULL) wm_clear_default_size(C);
+ if (BLI_listbase_is_empty(&wmbase)) {
+ wm_clear_default_size(C);
+ }
BLI_init_temporary_dir(U.tempdir);
#ifdef WITH_PYTHON_SECURITY
@@ -715,7 +717,7 @@ void wm_read_history(void)
lines = BLI_file_read_as_lines(name);
- G.recent_files.first = G.recent_files.last = NULL;
+ BLI_listbase_clear(&G.recent_files);
/* read list of recent opened files from recent-files.txt to memory */
for (l = lines, num = 0; l && (num < U.recent_files); l = l->next) {
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index c13d1dca0c4..d6ceb8caf29 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -344,7 +344,7 @@ static wmKeyMap *wm_keymap_copy(wmKeyMap *keymap)
keymapn->modal_items = keymap->modal_items;
keymapn->poll = keymap->poll;
- keymapn->items.first = keymapn->items.last = NULL;
+ BLI_listbase_clear(&keymapn->items);
keymapn->flag &= ~(KEYMAP_UPDATE | KEYMAP_EXPANDED);
for (kmdi = keymap->diff_items.first; kmdi; kmdi = kmdi->next) {
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index af01cf10708..4e39394b1bc 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -3978,7 +3978,7 @@ static int radial_control_invoke(bContext *C, wmOperator *op, const wmEvent *eve
/* temporarily disable other paint cursors */
wm = CTX_wm_manager(C);
rc->orig_paintcursors = wm->paintcursors;
- wm->paintcursors.first = wm->paintcursors.last = NULL;
+ BLI_listbase_clear(&wm->paintcursors);
/* add radial control paint cursor */
rc->cursor = WM_paint_cursor_activate(wm, op->type->poll,